| | 1 | = Variable entity = |
| | 2 | |
| | 3 | Variable entities hold all the information about variables, such as binding expressions, scopes etc. |
| | 4 | |
| | 5 | == Initial selector == |
| | 6 | * {{{@var}}} to start a query with a variable entity, use this selector to refer to the selected variable. |
| | 7 | |
| | 8 | == Selectors == |
| | 9 | The following selectors can be used on variable entities. |
| | 10 | |
| | 11 | ''After the name of the selector between parentheses you can find the type of the elements in the resulted set.'' |
| | 12 | |
| | 13 | * {{{refs}}} (''expression''): returns the set of expression entities that refer to the variable. |
| | 14 | * {{{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. |
| | 15 | * {{{fundef}}} (''function''): gives the function entity which contains the binding (definition) of the variable. |
| | 16 | |
| | 17 | == Properties == |
| | 18 | There is only one property for a variable: |
| | 19 | * {{{name}}} (''atom, string''): returns the name (identifier) of the variable. |