DEBUG

DEBUG (-- debugCondition)

Inputs

Outputs

This builtin has no inputs. It pushes a known Cond value that reflects the program's debug-mode setting.

DEBUG is a value builtin. It does not affect later declarations or scope state.

Because the actual setting may be either enabled or disabled, the example below does not hardcode one particular value. It instead shows two stable facts: DEBUG is known at compile time, and it is always either FALSE or TRUE.

Behavior

Example

{} 0 {} [
  "-- DEBUG is a known Cond --" printCompilerMessage
  DEBUG known? printStack _:;

  "-- DEBUG is either TRUE or FALSE --" printCompilerMessage
  DEBUG FALSE = DEBUG TRUE = or printStack _:;

  0
] "main" exportFunction

Expected Output During Compilation

-- DEBUG is a known Cond --
TRUE
-- DEBUG is either TRUE or FALSE --
TRUE

See also