Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Language reference > Expressions > Type operators

Type operators

Type operators are used to check if some expression evaluates to a given type.

Is Type of expression...
defined Is defined, i.e., not anvil.lang.undefined.
undefined Is anvil.lang.undefined.
null Is anvil.lang.null.
boolean Is anvil.lang.boolean.
int Is anvil.lang.int.
float Is anvil.lang.float.
string Is anvil.lang.string.
.. Is anvil.lang.range.
() Is anvil.lang.tuple.
{} Is anvil.lang.list.
[] Is anvil.lang.array.
class Is a class.
& Is a ref.
identifier Is of a given type; identifier must point to a class or interface.

If ``is´´ if followed by ``!´´ the meaning of expression is negated. Read as, "x is NOT y".

  is-expr := expr "is" ["!"] "defined" 
  is-expr := expr "is" ["!"] "undefined" 
  is-expr := expr "is" ["!"] "null" 
  is-expr := expr "is" ["!"] "boolean" 
  is-expr := expr "is" ["!"] "int" 
  is-expr := expr "is" ["!"] "float" 
  is-expr := expr "is" ["!"] "string" 
  is-expr := expr "is" ["!"] "&" 
  is-expr := expr "is" ["!"] ".." 
  is-expr := expr "is" ["!"] "=>" 
  is-expr := expr "is" ["!"] "(" ")" 
  is-expr := expr "is" ["!"] "{" "}" 
  is-expr := expr "is" ["!"] "[" "]" 
  is-expr := expr "is" ["!"] "class" 
  is-expr := expr "is" ["!"] entityclass-of-interface 
See also  | Expressions  | Grammar
Contributes notes:
Add a note
What's new | Anvil