Skip to content
This site is for a previous version of RelationalAI.

Variable Scope

All variables have to be explicitly introduced to clarify their scope.

Every variable is introduced by a binding. The formal parameter specification in the head of a definition is also a form of binding.

A local scalar variable x shadows relation definitions, schema, and natives with name x.

For example, in the definition of foo, the local variable nation shadows the previous definition of nation.

def nation = ...
def foo = nation: ...

Variable scope is static, not dynamic. This means that the local variable nation only shadows variables that are lexically in its scope.

Next: Higher-Order Definitions

Was this doc helpful?