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
any
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 pthread_mutexa
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 t
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] http://c
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 ty
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 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.
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 assert(__
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
have installed is part of a MinGW installation and complains
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
ha
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
corre
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 som
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 o
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 t
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 ra
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 as
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...
i
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 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 sequence
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 will
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?
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 core.sy
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 wa
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, b
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 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: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 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,
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)
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
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" jun
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 wa
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
Y
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.
It's
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 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
cal
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 from
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?
why
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.
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
c
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 p
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 pe
42 matches
Mail list logo