Thread overview
-debug question
Jan 21, 2022
forkit
Jan 21, 2022
forkit
Jan 21, 2022
Ali Çehreli
January 21, 2022
I have a line of code, that I do NOT want executed when -debug is passed in.

enforce(!exists(fname), "Oop! That file already exists!");

Is this even possible? (with using -version ..)

January 20, 2022

On 1/20/22 9:07 PM, forkit wrote:

>

I have a line of code, that I do NOT want executed when -debug is passed in.

enforce(!exists(fname), "Oop! That file already exists!");

Is this even possible? (with using -version ..)

debug is like a version block.

debug {} else {
  // code that runs when -debug is not present
}

-Steve

January 20, 2022
On 1/20/22 18:07, forkit wrote:
> I have a line of code, that I do NOT want executed when -debug is passed in.
> 
> enforce(!exists(fname), "Oop! That file already exists!");
> 
> Is this even possible? (with using -version ..)
> 

The following should do it:

debug {} else {
   foo();
}

Ali
January 21, 2022
On Friday, 21 January 2022 at 02:10:34 UTC, Steven Schveighoffer wrote:
>

thanks Steven (and Ali too).