Re: D compiler equivilent of "gcc -E" for debug/view template instantiation(generated) code?

2021-07-29 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 July 2021 at 06:00:41 UTC, dangbinghoo wrote: hi, is there any D compiler option or other method to view the final template instantiation but not compiled (in asm or binary) code? if there's a way, it might be very usefull for newbies like me to learn and understand the the Meta

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

D compiler equivilent of "gcc -E" for debug/view template instantiation(generated) code?

2021-07-29 Thread dangbinghoo via Digitalmars-d-learn
hi, is there any D compiler option or other method to view the final template instantiation but not compiled (in asm or binary) code? if there's a way, it might be very usefull for newbies like me to learn and understand the the Meta programming of dlang. thanks! dbh

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

Re: Raylib linking error

2021-07-29 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 29 July 2021 at 10:07:15 UTC, Ki wrote: On Thursday, 29 July 2021 at 07:59:38 UTC, Ki wrote: I tried to compile a new project with Raylib yesterday: dub init => ... => dub add raylib-d. My dub.json file does contain the "libs": ["raylib"] section, so the compiler links against ray

Re: Raylib linking error

2021-07-29 Thread Ki via Digitalmars-d-learn
On Thursday, 29 July 2021 at 07:59:38 UTC, Ki wrote: I tried to compile a new project with Raylib yesterday: dub init => ... => dub add raylib-d. My dub.json file does contain the "libs": ["raylib"] section, so the compiler links against raylib library. Then I built the project and got a linke

Raylib linking error

2021-07-29 Thread Ki via Digitalmars-d-learn
I tried to compile a new project with Raylib yesterday: dub init => ... => dub add raylib-d. My dub.json file does contain the "libs": ["raylib"] section, so the compiler links against raylib library. Then I built the project and got a linker error referencing a whole bunch of opengl, glfw fun