Skip to main content

Special Variables

Laurence MorganAbout 2 minSpecial Variables

Special Variables

Variables are typed.

They can be a primitive like int or str. They can also be a structured document like json, csv or sexpr.

Variables can also have a string representation, for compatibility with older POSIX idioms, as well as a native object format.

Glossary Of Terms

To help better understand how variables work under the hood, blow is a glossary of terms:

  • primitive: this refers to the atomic component of a data-type. In other words, the smallest possible format for a piece of data. Where a JSON file might arrays and maps, the values for those objects cannot be divided any smaller than numbers, strings or a small number of constants like true, false, and null.

  • scope: this is how far outside the code block that a particular variable can be written to, or read from.

  • local (scope): this refers to variables that cannot be read nor modified outside of the current function. Thus one function cannot read nor write to a variable in another function.

  • module (scope): these variables are accessible by any function or routine from within the same module. You'll only need module scoped variables if you're writing modules -- and even then, only if you want that variable available to all functions within that module.

  • global (scope): these are variables which are accessible from any function, anywhere within Murex.

  • environmental variables: sometimes written as env vars for short, these are system variables. They can be passed from one process to another, so careful what secrets you store and what software you run while you have sensitive env vars defined.

  • reserved variables: this refers to variables that are read only. Some reserved variables are dynamic and thus can change their value depending on contextual circumstances.

Pages