On Friday, 24 February 2017 at 07:38:04 UTC, Mike Parker wrote:
On Friday, 24 February 2017 at 04:22:17 UTC, Jonathan Marler
wrote:
I discovered the .capacity property of arrays. I don't know
why I've never seen this but it looks like this is how readln
is recovering this seemingly lost
On Friday, 24 February 2017 at 04:22:17 UTC, Jonathan Marler
wrote:
I discovered the .capacity property of arrays. I don't know
why I've never seen this but it looks like this is how readln
is recovering this seemingly lost peice of data. This does
have an odd consequence though, if you
Arun Chandrasekaran wrote:
On Thursday, 23 February 2017 at 09:57:09 UTC, ketmar wrote:
Thanks for your help. NRVO looks interesting. However this may not be
RAII after all. Or may be too much of C++ has spoiled me. I am not
familiar enough with D to appreciate/question the language design
Jack Stouffer wrote:
This is something that valgrind could have easily picked up, but the
devs just didn't use it for some reason. Runtime checking of this
stuff is important, so please, don't disable safety checks with DMD
if you're dealing with personal info.
or, even better: don't
On Thursday, 23 February 2017 at 21:05:48 UTC, cym13 wrote:
It reminds me of
https://w0rp.com/blog/post/an-raii-constructor-by-another-name-is-just-as-sweet/ which isn't what you want but may be interesting anyway.
It is interesting, indeed, thanks.
On Thursday, 23 February 2017 at 09:57:09 UTC, ketmar wrote:
Arun Chandrasekaran wrote:
I'm trying to write an RAII wrapper on Linux.
I understand struct in D doesn't have default constructor (for
.init reasons).
I don't want to use `scope`.
Is there an elegant way to achieve this in D?
https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
A buffer overflow bug caused heartblead 2.0 for hundreds of
thousands of sites. Here we are 57 years after ALGOL 60 which had
bounds checking, and we're still dealing with bugs from C's
massive mistake.
This is something that
On Friday, 24 February 2017 at 03:45:35 UTC, Nick Sabalausky
(Abscissa) wrote:
On 02/23/2017 09:43 PM, Jonathan Marler wrote:
I can't figure out how to make use of the full capacity of
buffers that
are allocated by readln. Take the example code from the
documentation:
// Read lines
On 02/23/2017 10:36 PM, Adam D. Ruppe wrote:
On Friday, 24 February 2017 at 02:50:27 UTC, Nick Sabalausky (Abscissa)
wrote:
What I'd kinda like to do is put together a D doc generator that uses,
uhh, probably markdown.
My dpldocs.info generator continues to progress and I'm almost ready to
https://issues.dlang.org/show_bug.cgi?id=17220
Stefan Koch changed:
What|Removed |Added
Hardware|x86 |x86_64
--- Comment #1
On 02/23/2017 09:43 PM, Jonathan Marler wrote:
I can't figure out how to make use of the full capacity of buffers that
are allocated by readln. Take the example code from the documentation:
// Read lines from $(D stdin) and count words
void main()
{
char[] buf;
On Friday, 24 February 2017 at 02:50:27 UTC, Nick Sabalausky
(Abscissa) wrote:
What I'd kinda like to do is put together a D doc generator
that uses, uhh, probably markdown.
My dpldocs.info generator continues to progress and I'm almost
ready to call it beta and let other people use it.
On 24/02/2017 11:55 AM, Sönke Ludwig wrote:
The virtual server that is running code.dlang.org has frozen about an
hour ago and fails to boot further than to the bootloader. Initial
attempts to recover from within Grub have failed and it's unclear what
the root cause is. I will instead set up a
You can use the C++ plugin, which provides a debugger. Just make
sure you aren't using optlink, I don't think it generates
compatible files. Also you might need to use "-gc" which
generates debug names to be in C format.
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
On 02/23/2017 04:34 PM, Ali Çehreli wrote:
(None of the following is tested.)
a) Try using the following macro:
COLON =
And then use "Note$(COLON) Blah".
Thanks, that works.
c) Another option:
NOTE = Note $0
Then use "$(NOTE Blah)"
Actually, that's more or less what I was
https://issues.dlang.org/show_bug.cgi?id=17220
Stefan Koch changed:
What|Removed |Added
CC||uplink.co...@gmail.com
On 02/23/2017 04:49 PM, H. S. Teoh via Digitalmars-d-learn wrote:
I'm becoming more and more convinced that software that tries to be
smart ends up being even dumber than before.
I've been convinced of that for a long time ;) Not just software either.
Anything. My car does idiotic "smart"
On 02/23/2017 04:51 PM, Adam D. Ruppe wrote:
On Thursday, 23 February 2017 at 21:39:11 UTC, H. S. Teoh
Apparently COLON is defined to be ':' in the default ddoc macros, so
you needn't define it yourself.
Oh yeah.
Still, barf.
Luckily in my case, the "Word:" part is already generated inside
I can't figure out how to make use of the full capacity of
buffers that are allocated by readln. Take the example code from
the documentation:
// Read lines from $(D stdin) and count words
void main()
{
char[] buf;
size_t words = 0;
while (!stdin.eof)
https://issues.dlang.org/show_bug.cgi?id=17220
Issue ID: 17220
Summary: invalid code with -m32 -inline and struct that's 4x
the size of an assigned enum value
Product: D
Version: D2
Hardware: x86
OS: Linux
On Wed, 22 Feb 2017 18:31:37 -0800, Jonathan M Davis via Digitalmars-d
wrote:
> On Thursday, February 23, 2017 02:17:02 Jeremy DeHaan via Digitalmars-d
> wrote:
>> On Thursday, 23 February 2017 at 01:48:40 UTC, Seb wrote:
>> > AFAICT though it was approved, the switch to final by default has
>> >
Am 23.02.2017 um 23:55 schrieb Sönke Ludwig:
The virtual server that is running code.dlang.org has frozen about an
hour ago and fails to boot further than to the bootloader. Initial
attempts to recover from within Grub have failed and it's unclear what
the root cause is. I will instead set up a
On Thursday, 23 February 2017 at 22:55:05 UTC, Sönke Ludwig wrote:
The virtual server that is running code.dlang.org has frozen
about an hour ago and fails to boot further than to the
bootloader. Initial attempts to recover from within Grub have
failed and it's unclear what the root cause is.
The virtual server that is running code.dlang.org has frozen about an
hour ago and fails to boot further than to the bootloader. Initial
attempts to recover from within Grub have failed and it's unclear what
the root cause is. I will instead set up a replacement server with the
latest backup
On Thu, Feb 23, 2017 at 01:39:11PM -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
[...]
> Nah, that's overkill. This works:
>
> Note$(COLON) blah blah blah
>
> Apparently COLON is defined to be ':' in the default ddoc macros, so
> you needn't define it yourself.
[...]
Bah, I was wrong,
On Thursday, 23 February 2017 at 21:39:11 UTC, H. S. Teoh
Apparently COLON is defined to be ':' in the default ddoc
macros, so you needn't define it yourself.
Oh yeah.
Still, barf.
On Thu, Feb 23, 2017 at 09:35:41PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Thursday, 23 February 2017 at 21:17:33 UTC, H. S. Teoh wrote:
> > _Note: Blah blabbety blah
>
> Nope.
>
> Ddoc considers [A-Za-z_]+: to be a section header. You can trick it by
> doing something like
On Thursday, 23 February 2017 at 21:17:33 UTC, H. S. Teoh wrote:
_Note: Blah blabbety blah
Nope.
Ddoc considers [A-Za-z_]+: to be a section header. You can trick
it by doing something like
/++
Note: ass
+/
Yes, the html entity for a space. That trick's ddoc's stupid
parser while
On 02/23/2017 01:04 PM, Nick Sabalausky (Abscissa) wrote:
Suppose I want ddoc output to include this line:
--
Note: Blah blabbety blah
--
But the colon causes "Note" to be considered a section header. Is there
a way to escape the ":" so that it's displayed as expected,
On Thu, Feb 23, 2017 at 04:04:39PM -0500, Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> Suppose I want ddoc output to include this line:
>
> --
> Note: Blah blabbety blah
> --
>
> But the colon causes "Note" to be considered a section header. Is
> there a
https://issues.dlang.org/show_bug.cgi?id=17218
ZombineDev changed:
What|Removed |Added
Keywords||wrong-code
On Thursday, 23 February 2017 at 09:52:26 UTC, Arun
Chandrasekaran wrote:
I'm trying to write an RAII wrapper on Linux.
I understand struct in D doesn't have default constructor (for
.init reasons).
I don't want to use `scope`.
Is there an elegant way to achieve this in D?
```
import
Suppose I want ddoc output to include this line:
--
Note: Blah blabbety blah
--
But the colon causes "Note" to be considered a section header. Is there
a way to escape the ":" so that it's displayed as expected, but doesn't
trigger a section?
https://issues.dlang.org/show_bug.cgi?id=14413
Nick Sabalausky changed:
What|Removed |Added
Resolution|WONTFIX |FIXED
---
On 2/23/2017 10:54 AM, Steven Schveighoffer wrote:
On 2/22/17 6:24 PM, Walter Bright wrote:
Feb 28 is coming up fast!
Website says 2/26. Which is correct?
-Steve
Probably 2/26. It's better to not procrastinate anyway.
On Thursday, 23 February 2017 at 19:57:18 UTC, Patrick Schluter
wrote:
Marking the method as @pure changes anything?
Here is the link to play with it yourself :-)
https://godbolt.org/g/se4dCZ
On Thursday, 23 February 2017 at 18:35:29 UTC, Profile Anaysis
wrote:
[...]
option 1 is the one I was shooting for. does the static if
(audio) just check for the existence of audio, or does it also
check to see if audio is true as well?
Yes, but it checks at compile time. So the code
https://issues.dlang.org/show_bug.cgi?id=11847
ZombineDev changed:
What|Removed |Added
CC|
On Thursday, 23 February 2017 at 17:02:55 UTC, Johan Engelen
wrote:
On Thursday, 23 February 2017 at 16:25:34 UTC, Johan Engelen
wrote:
[...]
We're in good company: both clang and gcc also do not
devirtualize the call when the loopcount is too large (when the
loop count is 4, the indirect
On Thursday, 23 February 2017 at 17:44:05 UTC, HeiHon wrote:
Generally postscript files may contain binary data.
Think of included images or font data.
So in postscript files there should normally be no utf-8
encoded text, but binary data are quite usual.
Think of postscript files as a
Minor update to scriptlike (Utility library to help you write
script-like programs in D)
Aside from a few doc updates, this just fixes deprecation warnings when
compiling with DMD 2.072 and up.
https://github.com/Abscissa/scriptlike
On 02/23/2017 10:54 AM, Steven Schveighoffer wrote:
On 2/22/17 6:24 PM, Walter Bright wrote:
Feb 28 is coming up fast!
Website says 2/26. Which is correct?
-Steve
Always the later date... ;)
Ali
On Thursday, 23 February 2017 at 17:23:11 UTC, Nick Sabalausky
(Abscissa) wrote:
And most of those ways being "wrong" or dangerous. And, as you
mentioned, certain "right" ways becoming "wrong" seemingly
every few years.
Not necessarily wrong, but either limited to specific scenarios
or
On Thursday, 23 February 2017 at 18:46:58 UTC, kinke wrote:
A constructor is just a factory function with a special name...
Wrt. the special name, that's obviously extremely useful for
generic templates (containers etc.).
On 2/22/17 6:24 PM, Walter Bright wrote:
Feb 28 is coming up fast!
Website says 2/26. Which is correct?
-Steve
On Thursday, 23 February 2017 at 14:24:14 UTC, Adam D. Ruppe
wrote:
On Thursday, 23 February 2017 at 10:48:38 UTC, kinke wrote:
That's not elegant. You need a factory function for each type
containing one of these structs then.
A constructor is just a factory function with a special name...
On Thursday, 23 February 2017 at 17:54:09 UTC, FR wrote:
gdb is in my path, I can run it from the command line. When I
run 'gdb test.exe' (test.exe being the binary placed in my
workspace folder), I get the error message "not in executable
format: File format not recognized", whether I build
There are a few options:
1. static if(audio)
2. version(audio)
3. if (audio)
It looks like you are trying to create the version(audio)
semantic(if exists then use, else don't).
Ultimately, though, if you are trying to make a binary that
can either use audio or not depending on where it is
On Thursday, 23 February 2017 at 18:21:51 UTC, Meta wrote:
On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin
wrote:
Is there any way to get a reference/alias to the instantiation
of a template function that would be called, given certain
parameters? I.e. to get the result of whatever
On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin wrote:
Is there any way to get a reference/alias to the instantiation
of a template function that would be called, given certain
parameters? I.e. to get the result of whatever template
parameter inference (and overload resolution) has
On Thursday, 23 February 2017 at 16:30:08 UTC, WebFreak001 wrote:
I don't know how to build mago-mi either, but you can obtain it
from the bundle with dlangide
https://github.com/buggins/dlangide/releases/download/v0.6.11/dlangide-v0_6_11-bin-win32_x86-magomi-v0_3_1.zip
Thanks, that got me
On Thursday, 23 February 2017 at 08:34:53 UTC, berni wrote:
On Wednesday, 22 February 2017 at 21:23:45 UTC, H. S. Teoh
wrote:
enforce(!s.any!"a > 127");
Puh, it's lot's of possibilities to choose of, now... I thought
of something like the foreach-loop but wasn't sure if that is
On 02/23/2017 09:24 AM, Ola Fosheim Grøstad wrote:
It is not so much about being able to express something as it is about
having N different convoluted ways to express the same thing.
And most of those ways being "wrong" or dangerous. And, as you
mentioned, certain "right" ways becoming
On Thursday, 23 February 2017 at 16:25:34 UTC, Johan Engelen
wrote:
On Wednesday, 22 February 2017 at 23:49:43 UTC, Dušan Pavkov
wrote:
If the function is outside of class code runs much faster. I'm
obviously doing something wrong and would appreciate any help
with this.
Interesting test
On Thursday, 23 February 2017 at 16:28:26 UTC, FR wrote:
Hi everyone,
as the subject says, I'm trying to get a debugger running with
visual studio code on windows.
I have installed WebFreak001's code-d and debug extensions but
fail to figure out how to install a working debugger. The gdb I
On Wednesday, 22 February 2017 at 23:49:43 UTC, Dušan Pavkov
wrote:
If the function is outside of class code runs much faster. I'm
obviously doing something wrong and would appreciate any help
with this.
Interesting test case, thanks :-)
Adding "final" to the class method nullifies the
Is there any way to get a reference/alias to the instantiation of
a template function that would be called, given certain
parameters? I.e. to get the result of whatever template parameter
inference (and overload resolution) has occurred?
E.g. for some arbitrarily complex foo:
static
https://issues.dlang.org/show_bug.cgi?id=17219
--- Comment #1 from John Colvin ---
One also gets this weirdness:
void foo(alias bar)()
{
static int bar0(T...)(T t) { return 0; }
alias bar = bar0;
pragma(msg, __traits(identifier, __traits(parent,
https://issues.dlang.org/show_bug.cgi?id=17219
Issue ID: 17219
Summary: variable shadowing and overload sets
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
On Saturday, 18 February 2017 at 16:57:33 UTC, Seb wrote:
As imho the border doesn't look that bad and for the same
reason as above I didn't remove the border. See a visual
comparison here:
http://imgur.com/a/pElAu
Are you or others still in favor of removing the border?
I like the first
On Thursday, 23 February 2017 at 10:48:38 UTC, kinke wrote:
That's not elegant. You need a factory function for each type
containing one of these structs then.
A constructor is just a factory function with a special name...
it is almost equal amount of work.
On Thursday, 23 February 2017 at 07:36:11 UTC, Shachar Shemesh
wrote:
That is a matter of perspective. I, for one, feel other
languages put too much constraints on, making me work quite
hard to get what I want expressed in the language, often
blocking me from the most efficient implementation
Hey all,
As I own dub.pm since a year and it hasn't been used much, I have
just configured automatic sub-domain rewriting, s.t. everyone can
have nice and fancy URLs. All sub-domains get redirected to their
respective DUB package page, so now you can browse e.g.
eventcore.dub.pm
https://issues.dlang.org/show_bug.cgi?id=17164
--- Comment #2 from Jacob Carlborg ---
It's documented for D1 [1], under "C-style Variadic Functions". I still think
it's a regressions, this code originated from D1.
[1] http://www.digitalmars.com/d/1.0/function.html
--
https://issues.dlang.org/show_bug.cgi?id=17218
Alex Goltman changed:
What|Removed |Added
Hardware|x86 |x86_64
https://issues.dlang.org/show_bug.cgi?id=17218
Issue ID: 17218
Summary: foreach on tupleof inside switch returns ref to
undefined address
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status:
On Thursday, 23 February 2017 at 09:52:26 UTC, Arun
Chandrasekaran wrote:
I'm trying to write an RAII wrapper on Linux.
I understand struct in D doesn't have default constructor (for
.init reasons).
I don't want to use `scope`.
Is there an elegant way to achieve this in D?
static opCall()
On Thursday, 23 February 2017 at 09:57:09 UTC, ketmar wrote:
Arun Chandrasekaran wrote:
Is there an elegant way to achieve this in D?
why not static method or free function that returns struct? due
to NRVO[0] it won't even be copied.
That's not elegant. You need a factory function for each
On Sunday, 19 February 2017 at 09:21:40 UTC, aberba wrote:
On Sunday, 19 February 2017 at 08:01:56 UTC, dummy wrote:
[...]
You can use any D lib with http GET support (Vibe.d[1]:
download, requests[2]) at code.dlang.org. arsd.dom[3] has dom
parsing support. or use any XML lib.
[1]
Arun Chandrasekaran wrote:
I'm trying to write an RAII wrapper on Linux.
I understand struct in D doesn't have default constructor (for .init
reasons).
I don't want to use `scope`.
Is there an elegant way to achieve this in D?
why not static method or free function that returns struct? due
I'm trying to write an RAII wrapper on Linux.
I understand struct in D doesn't have default constructor (for
.init reasons).
I don't want to use `scope`.
Is there an elegant way to achieve this in D?
```
import core.sys.posix.pthread;
import core.sys.posix.sys.types;
/// Makes
On Wednesday, 22 February 2017 at 11:29:27 UTC, Alex wrote:
The point is that the thread object could be 20 layers of
encapsulation down in a library.
The thread could also be added 20 layers down long after the
main function was written and tested.
Here is what works for me:
- having a
On Wednesday, 22 February 2017 at 21:23:45 UTC, H. S. Teoh wrote:
enforce(!s.any!"a > 127");
Puh, it's lot's of possibilities to choose of, now... I thought
of something like the foreach-loop but wasn't sure if that is
correct for all utf encodings. All in all, I think I take the
73 matches
Mail list logo