Re: probably a trivial question...

2022-10-13 Thread rassoc via Digitalmars-d-learn
On 10/14/22 01:43, WhatMeWorry via Digitalmars-d-learn wrote: Does D provide any guidance as to what is preferred or are they identical for all intents and purposes? You won't see a difference for this specific example since the split function supports character, string and even range separat

Re: probably a trivial question...

2022-10-13 Thread Ali Çehreli via Digitalmars-d-learn
Changing the order of lines... On 10/13/22 16:43, WhatMeWorry wrote: > return s.split(';'); // single quotes That one is a single character and very lightweigth because it's just an integral value. You can't put more than one character within single quotes: ';x' // ERROR > return s.split(

probably a trivial question...

2022-10-13 Thread WhatMeWorry via Digitalmars-d-learn
I was a little (nicely) surprised that I could use double quotes, single quotes, or back ticks in the following line of code. return s.split(";"); // double quotes or return s.split(';'); // single quotes or return s.split(`;`); // back ticks Does D provide any guidance as to what is pref

Re: Probably a trivial question regarding version identifier and unittest

2020-05-11 Thread WhatMe Worry via Digitalmars-d-learn
On Tuesday, 12 May 2020 at 02:17:36 UTC, Adam D. Ruppe wrote: On Tuesday, 12 May 2020 at 01:54:49 UTC, WhatMeWorry wrote: [...] The unittest {} block is actually a special syntax for a function. So the main function in here is a *nested* function inside the unittest function and thus doesn't

Re: Probably a trivial question regarding version identifier and unittest

2020-05-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 May 2020 at 01:54:49 UTC, WhatMeWorry wrote: version(demos) unittest { import arsd.terminal; void main() Shouldn't the version identifier demos and the unittest option activate the test block and therefore defines main() which then give the "Start Address"? The unitte

Re: Probably a trivial question regarding version identifier and unittest

2020-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/20 9:54 PM, WhatMeWorry wrote: I'm trying to study Adam Ruppe's terminal.d sub-package and I see the following code segment: version(demos) unittest {     import arsd.terminal;     void main()     {     // . . .     }     main; // exclude from docs } Looks like a good bab

Probably a trivial question regarding version identifier and unittest

2020-05-11 Thread WhatMeWorry via Digitalmars-d-learn
I'm trying to study Adam Ruppe's terminal.d sub-package and I see the following code segment: version(demos) unittest { import arsd.terminal; void main() { // . . . } main; // exclude from docs } Looks like a good baby step to take, so in the command line I use: