These are commands usable from a CBQN REPL that, for one reason or another, aren't suited to be system functions.
Equivalent to •Exit 0
Execute the contents of the file as if it were REPL input (but allowing multiline definitions). Not a system function because modifying the list of global variables during execution is not allowed.
Execute the expression, but don't print its result.
Clear the cache of monadic •Import
calls, resulting in re-evaluating the source the next time one is executed.
Time the argument expression. n
specifies the number of times to repeat. Exists to allow not escaping quotes and less overhead for timing very fast & small expressions.
Display a syntax breakdown of the expression
Profile the expression at the given sampling frequency, or 5000 samples/second by default.
List the globally defined variables.
Changes the color scheme of syntax highlighting; Supported: )theme light
, )theme dark
, )theme none
.
Enable or disable backslash input for BQN characters.
Set keyboard prefix character to a custom one. Default is backslash, i.e. )kb \
Erase the specified variable name.
Not a system function because it only clears the variables value (previous code ↩
ing it will still be able to), and to allow it to be executed even when the VM is completely out of memory such that it can't even parse REPL input BQN.
Parse \
-escapes and execute as REPL input. Primarily for external tools to be able to execute multiline input.
Get statistics on memory usage.
)mem t
to get usage per object type.
)mem s
to get a breakdown of the number of objects with a specific size.
)mem f
to get breakdown of free bucket counts per size.
Force garbage collection.
)gc disable
disables automatic garabage collection, and )gc enable
enables it again.
Not a system function because currently CBQN doesn't support garbage collection in the middle of program execution.
Use the internal object printing system to show the expression result. Mainly for debugging in situations where the BQN self-hosted formatter can't be used.