Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

References & Dereferencing

Lumen variables can be referenced and dereferenced directly, independent of the &var syntax used to pass output parameters to built-ins.

value = 20

ref = &value

deref = *ref
OperatorMeaning
&valueTake a reference to a variable’s storage slot
*refDereference — read the value a reference points to

A reference can be stored in a variable like any other value and passed around, then dereferenced later with * to read the current contents of the variable it points to.

Currently, dereferenced assignments (e.g. *ref = 10) are not supported.