35. static_let macro

The static_let module implements static_let pattern, which allows declaration of private global variables which are local to a scope.

All functions and symbols are in “static_let” module, use require to get access to it.

require daslib/static_let

35.1. Function annotations

StaticLetMacro

This macro implements the static_let and static_let_finalize functions.

35.2. Static variable declarations

static_let(blk: block<> const)

argument

argument type

blk

block<> const

Given a scope with the variable declarations, this function will make those variables global. Variable will be renamed under the hood, and all local access to it will be renamed as well.

static_let_finalize(blk: block<> const)

argument

argument type

blk

block<> const

This is very similar to regular static_let, but additionally the variable will be deleted on the context shutdown.