Re: String Theory Questions

2014-09-14 Thread Kagamin via Digitalmars-d-learn
On Sunday, 14 September 2014 at 00:34:56 UTC, WhatMeWorry wrote: So is one form (Empty strings versus null strings) considered better than the other? Or does it depend on the context? For all practical purposes they should be equivalent in D code. I suppose the distinction exists because

Re: Idiomatic async programming like C# async/await

2014-09-14 Thread Kagamin via Digitalmars-d-learn
On Friday, 12 September 2014 at 03:59:58 UTC, Cliff wrote: ...but std.parallelism.Task requires parameterization on the function which the task would execute - that is clearly an implementation detail of the store. I think, you can wrap the Task in a class. abstract class CTask { abstract

Re: Template alias parameters to local variables

2014-09-14 Thread Kagamin via Digitalmars-d-learn
Doesn't this cause infinite recursion?

Re: Template alias parameters to local variables

2014-09-14 Thread via Digitalmars-d-learn
On Sunday, 14 September 2014 at 09:29:16 UTC, Kagamin wrote: Doesn't this cause infinite recursion? No, because the inner templates are instantiated with different first template parameters. Even if all template parameters were the same, it would only be a runtime recursion.

Re: String Theory Questions

2014-09-14 Thread via Digitalmars-d-learn
On Sunday, 14 September 2014 at 09:07:26 UTC, Kagamin wrote: On Sunday, 14 September 2014 at 00:34:56 UTC, WhatMeWorry wrote: So is one form (Empty strings versus null strings) considered better than the other? Or does it depend on the context? For all practical purposes they should be

Recomended cairo bindings

2014-09-14 Thread Paul Z. Barsan via Digitalmars-d-learn
Hello, I want to use a cairo XlibSurface for painting in a project of mine and I don't know what bindings should I use. I've started with deimos.cairo which has a C-style syntax and works well on my linux machine. After I heard about dub, I switched to this build system and I ran into

Re: String Theory Questions

2014-09-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Sep 2014 09:07:25 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Also for some reason boolean value of a string is derived from ptr instead of length... meh. for the reason that all reference objects either null or non-null. empty string is non-null,

Re: String Theory Questions

2014-09-14 Thread Mike Parker via Digitalmars-d-learn
On 9/14/2014 2:09 AM, WhatMeWorry wrote: The name string is aliased to immutable(char)[] Why was immutable chosen? Why not mutable. Or why not just make another alias called strung where it is aliased to mutable(char)[] If you want a mutable array of characters, just use char[]. --- This

Re: String Theory Questions

2014-09-14 Thread AsmMan via Digitalmars-d-learn
On Saturday, 13 September 2014 at 23:21:09 UTC, David Nadlinger wrote: On Saturday, 13 September 2014 at 22:41:39 UTC, AsmMan wrote: D string are actullay C-strings? No. But string *literals* are guaranteed to be 0-terminated for easier interoperability with C code. David ah makes sense.

Re: Recomended cairo bindings

2014-09-14 Thread Robert burner Schadek via Digitalmars-d-learn
On Sunday, 14 September 2014 at 13:30:28 UTC, Paul Z. Barsan wrote: Hello, I want to use a cairo XlibSurface for painting in a project of mine and I don't know what bindings should I use. I've started with deimos.cairo which has a C-style syntax and works well on my linux machine. After I

Re: Recomended cairo bindings

2014-09-14 Thread evilrat via Digitalmars-d-learn
On Sunday, 14 September 2014 at 13:30:28 UTC, Paul Z. Barsan wrote: First of all, the cairo version in the dub registry is different from the deimos version. CairoD (dub pkg) has support for more surfaces and provides D-style wrappers but I get compile-time errors. When I try to get an

Re: Idiomatic async programming like C# async/await

2014-09-14 Thread Cliff via Digitalmars-d-learn
On Sunday, 14 September 2014 at 09:19:11 UTC, Kagamin wrote: On Friday, 12 September 2014 at 03:59:58 UTC, Cliff wrote: ...but std.parallelism.Task requires parameterization on the function which the task would execute - that is clearly an implementation detail of the store. I think, you can

Re: how to redirect stderr to stdout io in spawnProcess (eg stderr to stdout)?

2014-09-14 Thread Timothee Cour via Digitalmars-d-learn
ping? On Tue, Sep 9, 2014 at 6:48 PM, Timothee Cour thelastmamm...@gmail.com wrote: How to redirect io in spawnProcess (eg stderr to stdout)? is it safe to use it with a same File object for stderr and stdout as follows? Couldn't find this in the docs. auto logFile =File(...); auto pid =

Re: String Theory Questions

2014-09-14 Thread Kagamin via Digitalmars-d-learn
On Sunday, 14 September 2014 at 13:48:01 UTC, ketmar via Digitalmars-d-learn wrote: for the reason that all reference objects either null or non-null. empty string is non-null, so... it's C leftover actually. there are alot such leftovers in D. For pointers it's logical, but it doesn't work