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

2018-06-20 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 18 June 2018 at 21:10:03 UTC, Steven Schveighoffer wrote: It just means re-doing std.conv.to, which is pretty hairy, but also pretty well-organized. Ok. Where in std.conv do the string-to-enum conversions take place?

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

2018-06-20 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 09:27:14 UTC, Per Nordlöw wrote: On Monday, 18 June 2018 at 21:10:03 UTC, Steven Schveighoffer wrote: It just means re-doing std.conv.to, which is pretty hairy, but also pretty well-organized. Ok. Where in std.conv do the string-to-enum conversions take place?

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

2018-06-20 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 09:37:00 UTC, Per Nordlöw wrote: AFAICT, string-to-enum-conversion must include a switch containing a static foreach over all the enumerators, right? My suggestion for nothrow @nogc string-to-enum conversion with default value T toDefaulted(T)(scope const(char)

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

2018-06-20 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 09:52:04 UTC, Per Nordlöw wrote: My suggestion for nothrow @nogc string-to-enum conversion with default value T toDefaulted(T)(scope const(char)[] value, T defaultValue) @safe pure nothrow @nogc if (is(T == enum)) { switch (value) {

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

2018-06-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, June 20, 2018 09:37:00 Per Nordlöw via Digitalmars-d-learn wrote: > On Wednesday, 20 June 2018 at 09:27:14 UTC, Per Nordlöw wrote: > > On Monday, 18 June 2018 at 21:10:03 UTC, Steven Schveighoffer > > > > wrote: > >> It just means re-doing std.conv.to, which is pretty hairy, but > >>

Re: What is the point of nothrow?

2018-06-20 Thread Kagamin via Digitalmars-d-learn
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 before they close the terminal ? I just read stack trace from

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

2018-06-20 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 09:54:29 UTC, Per Nordlöw wrote: T toDefaulted(T)(scope const(char)[] value, T defaultValue) @safe pure nothrow @nogc if (is(T == enum)) { switch (value) { static foreach (index, member; __traits(allMembers, T)) { case

Lesson 1:Create the DOS Application, Rebuild error: c:\dm\lib\sds.lib(cinit): Previous Definition Different: __Exit ???

2018-06-20 Thread Terry Capps via Digitalmars-d-learn
I am a newbe to the C/C++ Development System. I downloaded the C/C++ Development System a couple of days ago. In following the directions for Lesson 1: Create the DOS Application, when I did the Rebuild (called for in the instructions), I got an error: Error: c:\dm\lib\sds.lib(cinit) : Previou

Re: Lesson 1:Create the DOS Application, Rebuild error: c:\dm\lib\sds.lib(cinit): Previous Definition Different: __Exit ???

2018-06-20 Thread rikki cattermole via Digitalmars-d-learn
This board is for the D programming language. The one you want is https://forum.dlang.org/group/c++

Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it, anywhere. Now, as I understand it, I would need to begin with making `main` a D f

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it, anywhere

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it, anywhere

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it, anywhere

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread user1234 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it, anywhere

Re: Lesson 1:Create the DOS Application, Rebuild error: c:\dm\lib\sds.lib(cinit): Previous Definition Different: __Exit ???

2018-06-20 Thread Ali Çehreli via Digitalmars-d-learn
On 06/20/2018 08:06 AM, rikki cattermole wrote: This board is for the D programming language. The one you want is https://forum.dlang.org/group/c++ And the Lesson 1 he wants is http://ddili.org/ders/d.en/hello_world.html :o) Ali

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 19:57:55 UTC, jmh530 wrote: I suppose that. [snip] I suppose that would be good.

Re: Zip vs Enumerate

2018-06-20 Thread Jordan Wilson via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 05:49:15 UTC, Dukc wrote: On Wednesday, 20 June 2018 at 03:44:58 UTC, Jordan Wilson wrote: Is there anything I can do to improve zip, before I go ahead and change to the faster but slightly less readable enumerate? The problem might be that zip checks both arrays

Vibe D Examples

2018-06-20 Thread infinityplusb via Digitalmars-d-learn
I'm trying to reacquaint myself with D, and Vibe in particular. I notice that some of my previous working apps now don't work. While going through the tour.dlang page, I can't seem to get any of those sample apps working either. Nor do the apps in Vibe's github page appear to be up to date with

Re: Vibe D Examples

2018-06-20 Thread infinityplusb via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 22:46:16 UTC, infinityplusb wrote: I'm trying to reacquaint myself with D, and Vibe in particular. I notice that some of my previous working apps now don't work. While going through the tour.dlang page, I can't seem to get any of those sample apps working either. N

using tuple as value type for associative array

2018-06-20 Thread Flaze07 via Digitalmars-d-learn
when I do Tuple!(uint, "first", uint, "second")[string] what; //I tried aliasing the tuple as well what["something"].first = 20; I get range error but when I do uint[string] what2; what2 = 20; I get none of those range error, so...how do I use tuple as value type for associative array ?

Re: using tuple as value type for associative array

2018-06-20 Thread Computermatronic via Digitalmars-d-learn
On Thursday, 21 June 2018 at 02:44:12 UTC, Flaze07 wrote: when I do Tuple!(uint, "first", uint, "second")[string] what; //I tried aliasing the tuple as well what["something"].first = 20; I get range error but when I do uint[string] what2; what2 = 20; I get none of those range error, so...how do

Re: using tuple as value type for associative array

2018-06-20 Thread Flaze07 via Digitalmars-d-learn
On Thursday, 21 June 2018 at 03:04:46 UTC, Computermatronic wrote: On Thursday, 21 June 2018 at 02:44:12 UTC, Flaze07 wrote: when I do Tuple!(uint, "first", uint, "second")[string] what; //I tried aliasing the tuple as well what["something"].first = 20; I get range error but when I do uint[str