null, strings, arrays, and objects are all Lion expressions, each evaluated according to its own rules. This homoiconic design means programs can be stored in databases, sent over HTTP, and generated by other systems — because they are already data.
- Primitives
- Arrays
- Objects
Numbers, booleans, and Evaluates to Evaluates to Evaluates to With Resolves to the stdlib addition function because
null are self-evaluating — they return themselves unchanged. Strings are treated as environment references: if the string matches a key in the current environment the bound value is returned; if no binding exists the string returns as-is.42.true.null.{ "x": 10 } in the environment, evaluates to 10. With no binding, evaluates to "x".stdlib contains a "number/add" key.Expression schema
Internally, Lion validates every value against theLionExpressionSchema before evaluation begins. The schema is a union of three branches:
Date, undefined, or a class instance — is rejected at the boundary before evaluation starts.