V: Compile time $if

Created on 14 Aug 2019  路  6Comments  路  Source: vlang/v

Compile time $if for non -prod builds, for debugging purposes, like put println of variables.

I don't know if that it's planned.

Feature Request

Most helpful comment

$if debug { ?

All 6 comments

$if debug { ?

Awesome idea!

Done. This program will print "hello" if built with -debug:

fn main() {
  $if debug {
    println('hello')
  }
}

Could you document it somewhere? Maybe:
https://vlang.io/docs#comp_if

A lot of thanks!!

Documentation has been updated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radare picture radare  路  3Comments

vtereshkov picture vtereshkov  路  3Comments

elimisteve picture elimisteve  路  3Comments

radare picture radare  路  3Comments

ArcDrake picture ArcDrake  路  3Comments