Re: Function in a slice instead of just pointer?

2018-06-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 21 June 2018 at 21:00:46 UTC, Michael Brown wrote: Hi D Community, Is it possible to get a slice of a function, rather than just its start pointer? No. I'm interested in currying a function at runtime - So I would need to copy a function block (Either the original function,

Function in a slice instead of just pointer?

2018-06-21 Thread Michael Brown via Digitalmars-d-learn
Hi D Community, Is it possible to get a slice of a function, rather than just its start pointer? I'm interested in currying a function at runtime - So I would need to copy a function block (Either the original function, a wrapper function, or copys of manually altered functions).

Re: Move and CTFE

2018-06-21 Thread Per Nordlöw via Digitalmars-d-learn
On Thursday, 21 June 2018 at 20:15:42 UTC, Stefan Koch wrote: To give some more context here: CTFE is the most well tested feature in dmd. So there is no room for sloppiness or functional differences! As you previously mentioned the newCTFE engine works on a completely different basis then the

Re: Move and CTFE

2018-06-21 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 23:07:26 UTC, Jonathan M Davis wrote: newCTFE is taking a very different approach to CTFE, and in theory, it will fix many of the problems that CTFE currently has, but it's taking Stefan quite a while to get it to where it needs to be to actually merge it. To

Re: Convert path to file system path on windows

2018-06-21 Thread FreeSlave via Digitalmars-d-learn
On Thursday, 21 June 2018 at 18:46:05 UTC, Dr.No wrote: How can I do that with D? In C# you can do that: var filename = @"C:\path\to\my\file.txt"; var file = new Uri(filename).AbsoluteUri; // file is "file:///C:/path/to/my/file.txt" How can I do that in D? import std.stdio; import

Re: Convert path to file system path on windows

2018-06-21 Thread Timoses via Digitalmars-d-learn
On Thursday, 21 June 2018 at 18:46:05 UTC, Dr.No wrote: How can I do that with D? In C# you can do that: var filename = @"C:\path\to\my\file.txt"; var file = new Uri(filename).AbsoluteUri; // file is "file:///C:/path/to/my/file.txt" How can I do that in D? I don't know of a specific

Re: What is the point of nothrow?

2018-06-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, June 21, 2018 13:16:28 wjoe via Digitalmars-d-learn wrote: > On Wednesday, 20 June 2018 at 12:22:33 UTC, Kagamin wrote: > > Do you know how to extract information from it on an unfamiliar > > OS? Reading stack trace is easier and self-evident. > > Counter question: How do you develop

Convert path to file system path on windows

2018-06-21 Thread Dr.No via Digitalmars-d-learn
How can I do that with D? In C# you can do that: var filename = @"C:\path\to\my\file.txt"; var file = new Uri(filename).AbsoluteUri; // file is "file:///C:/path/to/my/file.txt" How can I do that in D?

Re: What is the point of nothrow?

2018-06-21 Thread wjoe via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 12:22:33 UTC, Kagamin wrote: On Tuesday, 19 June 2018 at 15:03:49 UTC, wjoe wrote: But maybe I missed something else and the only purpose of D is to make console applications for *NIX like OSs and expect users to be professional enough to save that stack trace

Re: Nothrow std.conv.to with explicit default value

2018-06-21 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 14:39:48 UTC, Per Nordlöw wrote: Is there a way to avoid compile-time-string-concat plus mixin here? Using __traits(getMember, ...) should compile faster, right? T toDefaulted(T)(scope const(char)[] value, T defaultValue) @safe pure nothrow @nogc if (is(T ==

Re: Quick Refresher book?

2018-06-21 Thread Phyllis via Digitalmars-d-learn
On Saturday, 16 June 2018 at 23:33:18 UTC, Aedt wrote: Hello, I was wondering if there's any quick refresher resource to brush up on my D after a long time? Is there a short and quick language reference book like "A Tour of C++"? If you want to practice your coding skills I recommend you to