wiki:SemanticQuery/VariableEntity

Version 1 (modified by manualwiki, 13 years ago) (diff)

--

Variable entity

Variable entities hold all the information about variables, such as binding expressions, scopes etc.

Initial selector

  • @var to start a query with a variable entity, use this selector to refer to the selected variable.

Selectors

The following selectors can be used on variable entities.

After the name of the selector between parentheses you can find the type of the elements in the resulted set.

  • refs (expression): returns the set of expression entities that refer to the variable.
  • bindings (expression): returns the top-level expression that binds the expression. It is always a pattern expression, e.g. an argument of the function, or a pattern in a case construct. If the binding expression is ambiguous, every possible binding expression is returned.
  • fundef (function): gives the function entity which contains the binding (definition) of the variable.

Properties

There is only one property for a variable:

  • name (atom, string): returns the name (identifier) of the variable.