No matching definitions.

tur/dynvar

stdlib/dynvar.tur

dynamic variables and binding conveyance for cooperative tasks.

Declares the standard dynamic-var set and provides spawn-conveying helpers.

Since: Phase DV3

defdynamic

*log-level*

(defdynamic *log-level* :int 1)

logging verbosity threshold.

Convention: 0 = verbose/debug, 1 = info (default), 2 = warn, 3 = error. Code that conditionally logs checks (>= level *log-level*) or similar.

(binding [*log-level* 0]
  (log-debug "entering handler"))  ; visible only in verbose mode

Since: DV4

defdynamic

*locale*

(defdynamic *locale* :cstr "en-US")

BCP-47 locale tag used by formatting and i18n functions.

(binding [*locale* "fr-FR"]
  (format-currency 1234))  ; uses French number formatting

Since: DV4

defdynamic

*random-seed*

(defdynamic *random-seed* :int 0)

seed for the per-thread RNG.

0 (the default) means the RNG should use system entropy (e.g. /dev/urandom). Set to a non-zero value for reproducible results in tests.

(binding [*random-seed* 42]
  (random-int 100))  ; reproducible random number

Since: DV4

defdynamic

*current-module*

(defdynamic *current-module* :cstr "")

module name tag for structured log output.

Set by a module's preamble so that log lines include the module name without threading a logger argument through every function.

(binding [*current-module* "auth"]
  (log-info "token validated"))  ; log line shows "auth: token validated"

Since: DV4

defn

spawn-conveying

(spawn-conveying [f :ptr<void>])