Re: How to split a string/array with multiple separators?

2016-05-13 Thread Joel via Digitalmars-d-learn
On Wednesday, 16 December 2015 at 15:27:22 UTC, Marc Schütz wrote: On Wednesday, 16 December 2015 at 14:47:26 UTC, Dragos Carp wrote: On Wednesday, 16 December 2015 at 14:18:28 UTC, Borislav Kosharov wrote: I want to split a string using multiple separators. In std.array the split function has

Re: Request assistance converting C's #ifndef to D

2016-05-13 Thread Andrew Edwards via Digitalmars-d-learn
On 5/14/16 12:35 AM, Steven Schveighoffer wrote: On 5/13/16 12:59 AM, Andrew Edwards wrote: On 5/13/16 8:40 AM, Andrew Edwards wrote: That seems wrong. You can't assign to an enum. Besides, doesn't your declaration of MIN shadow whatever other definitions may be currently in effect? Okay, got

Re: Defining member fuctions of a class or struct out side of the class/struct body?

2016-05-13 Thread Ali Çehreli via Digitalmars-d-learn
On 05/13/2016 11:41 AM, Jamal wrote: Warning D newb here. Is it possible to define a member function outside of the class/struct like in C++; class x { body void foo(int* i); }; void x::foo(int* i){ *i++; } Or is it just D-like to define everything inside the class/struct body? Al

Re: Defining member fuctions of a class or struct out side of the class/struct body?

2016-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/16 2:41 PM, Jamal wrote: Warning D newb here. Is it possible to define a member function outside of the class/struct like in C++; Not within the same file. You can have an "interface file", extension .di, which hides the bodies of functions. But inside the implementation file, you mu

Defining member fuctions of a class or struct out side of the class/struct body?

2016-05-13 Thread Jamal via Digitalmars-d-learn
Warning D newb here. Is it possible to define a member function outside of the class/struct like in C++; class x { body void foo(int* i); }; void x::foo(int* i){ *i++; } Or is it just D-like to define everything inside the class/struct body?

Re: Request assistance converting C's #ifndef to D

2016-05-13 Thread sanjayss via Digitalmars-d-learn
On Thursday, 12 May 2016 at 22:51:17 UTC, Andrew Edwards wrote: The following preprocessor directives are frequently encountered in C code, providing a default constant value where the user of the code has not specified one: #ifndef MIN #define MIN 99 #endif

Re: imports && -run [Bug?]

2016-05-13 Thread zabruk70 via Digitalmars-d-learn
On Friday, 13 May 2016 at 06:33:40 UTC, Jacob Carlborg wrote: Even better is to use "rdmd" which will automatically track and compile dependencies. but i should warn about annoing bug with local import http://forum.dlang.org/post/mailman.1984.1373610213.13711.digitalmar...@puremagic.com https:/

Re: Request assistance converting C's #ifndef to D

2016-05-13 Thread Kagamin via Digitalmars-d-learn
On Thursday, 12 May 2016 at 22:51:17 UTC, Andrew Edwards wrote: The following preprocessor directives are frequently encountered in C code, providing a default constant value where the user of the code has not specified one: #ifndef MIN #define MIN 99 #endif

Re: Request assistance converting C's #ifndef to D

2016-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/16 12:59 AM, Andrew Edwards wrote: On 5/13/16 8:40 AM, Andrew Edwards wrote: That seems wrong. You can't assign to an enum. Besides, doesn't your declaration of MIN shadow whatever other definitions may be currently in effect? Okay, got it. It seams I just hadn't hit that bug yet becau

Re: imports && -run [Bug?]

2016-05-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-05-13 08:27, Andrew Edwards wrote: I fail to see why the compiler would be less capable at this task than rdmd. Since it is already build to accept multiple input files and knows more about what's going on during compilation than rdmd will ever know, in does not make sense that it should

Re: DMD flag -gs and -gx

2016-05-13 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 13 May 2016 at 10:19:04 UTC, Nordlöw wrote: -gsalways emit stack frame IIRC, not emitting a stack frame is an optimization which confuses debuggers. So I think this can be used to make optimized builds a bit easier to debug. -gxadd stack stomp code

Re: How to split a string/array with multiple separators?

2016-05-13 Thread Thorsten Sommer via Digitalmars-d-learn
Wow, thanks Steve :)

DMD flag -gs and -gx

2016-05-13 Thread Nordlöw via Digitalmars-d-learn
What role does the DMD flags -gs and -gx play? The documentation says -gsalways emit stack frame -gxadd stack stomp code which I don't know what it means.