Re: Exit before second main with -funittest

2021-07-31 Thread Ali Çehreli via Digitalmars-d-learn
On 7/30/21 7:48 PM, Brian TIffin wrote: > Found, find, C++ too hot for most to handle, so why? I rubbed shoulders with C++ people who would argue to the effect of "C++ was not meant to be for everyone." > And a deeper thanks, Ali, for the book. You're welcome. I am very happy when it is help

Re: Exit before second main with -funittest

2021-07-30 Thread Brian TIffin via Digitalmars-d-learn
On Friday, 30 July 2021 at 22:51:00 UTC, Ali Çehreli wrote: On 7/30/21 3:08 PM, Brian Tiffin wrote: > Don't take to C++, never have, even while watching > cfront and Walter having the first** brain to craft a native compiler. [...] > ** I'm not sure Walter was first first, or close first, or..

Re: Exit before second main with -funittest

2021-07-30 Thread Ali Çehreli via Digitalmars-d-learn
On 7/30/21 3:08 PM, Brian Tiffin wrote: > Don't take to C++, never have, even while watching > cfront and Walter having the first** brain to craft a native compiler. [...] > ** I'm not sure Walter was first first, or close first, or... He wrote the first C++ compiler. (cfront was a C++-to-C tr

Re: Exit before second main with -funittest

2021-07-30 Thread Brian Tiffin via Digitalmars-d-learn
On Friday, 30 July 2021 at 08:26:47 UTC, Bastiaan Veelo wrote: On Friday, 30 July 2021 at 05:51:41 UTC, Brian Tiffin wrote: [... interesting account of the D experience ...] **Kudos team and contributors.** Can't really suggest that many improvements to resources needed for learning D, as a

Re: Exit before second main with -funittest

2021-07-30 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 30 July 2021 at 05:51:41 UTC, Brian Tiffin wrote: [... interesting account of the D experience ...] **Kudos team and contributors.** Can't really suggest that many improvements to resources needed for learning D, as a hobbyist not on a clock, being new still and low enough to not

Re: Exit before second main with -funittest

2021-07-29 Thread Ali Çehreli via Digitalmars-d-learn
On 7/29/21 9:22 PM, Mathias LANG wrote: > On Friday, 30 July 2021 at 03:45:21 UTC, Ali Çehreli wrote: >> Almost all of my programs are in the following pattern: >> >> ```D >> import std.stdio; >> >> void main(string[] args) { >> version (unittest) { >> // Don't execute the main program when

Re: Exit before second main with -funittest

2021-07-29 Thread Brian Tiffin via Digitalmars-d-learn
On Friday, 30 July 2021 at 04:22:12 UTC, Mathias LANG wrote: On Friday, 30 July 2021 at 03:45:21 UTC, Ali Çehreli wrote: Almost all of my programs are in the following pattern: ```D import std.stdio; void main(string[] args) { version (unittest) { // Don't execute the main program when u

Re: Exit before second main with -funittest

2021-07-29 Thread Mathias LANG via Digitalmars-d-learn
On Friday, 30 July 2021 at 03:45:21 UTC, Ali Çehreli wrote: Almost all of my programs are in the following pattern: ```D import std.stdio; void main(string[] args) { version (unittest) { // Don't execute the main program when unit testing return; } } ``` Are you aware that this is

Re: Exit before second main with -funittest

2021-07-29 Thread Ali Çehreli via Digitalmars-d-learn
Almost all of my programs are in the following pattern: import std.stdio; void main(string[] args) { version (unittest) { // Don't execute the main program when unit testing return; } try { // Dispatch to the actual "main" function doIt(args); } catch (Exception exc) {

Re: Exit before second main with -funittest

2021-07-29 Thread jfondren via Digitalmars-d-learn
On Friday, 30 July 2021 at 01:01:02 UTC, Brian Tiffin wrote: Is this good, bad or indifferent (a right left choice, first one doesn't matter)? I think you're opening yourself up to errors where some program state persists from one run of main to another. You could think that some set of flags

Exit before second main with -funittest

2021-07-29 Thread Brian Tiffin via Digitalmars-d-learn
Is this good, bad or indifferent (a right left choice, first one doesn't matter)? ```d module cpuiding; /+ imports +/ import std.stdio: writeln; import core.cpuid; /++ start here +/ void main(string[] args) { writeln(args); writeln(processor()); writeln(vendor()); } /++ Self Test On