11.3. Literal Syntax and Evaluation

One of the most powerful features of an interpreter-based language such as Gamma is the ability to evaluate symbols and expressions at run-time. Gamma uses the # operator to indicate a literal expression. For those familiar with Lisp, this is equivalent to the forward quote syntax. Gamma also supports evaluation of sub-expressions, using the ` and @ operators. For more details on their use, see Quote Operators and further explanation below.

11.3.1. Literal Expressions

A literal expression is the expression that specifies an actual value rather than a function for creating the value. For example, the number 3 is a literal, where the expression (+ 1 2) is not. Similarly, the string "hello there" is a literal, and the expression string("hello ", "there") is not, yet they produce equal values when evaluated.

Most object types in Gamma have Lisp and Gamma literal forms. You can create a valid object of some types (such as numbers, symbols, and strings) by reading a literal from a file or the command line. Other types (such as arrays, classes, and functions) are created by corresponding statements or functions.

See Literals in the Reference Manual for definitions, notations, and examples of literal expressions in Gamma.