type/assignable
check if an object can be assigned to
Calling Sequence
Parameters
Description
Examples
type(expr, assignable)
type(expr, assignable(t))
expr
-
any expression
t
type
The function type(expr, 'assignable') returns true if the expression expr can be assigned to; otherwise, it returns false.
If the parameter t is included, it checks that expr is also of that type.
An expression is assignable if one of the following is true:
- It is a symbol and it is not protected.
- It is of type indexed and its zeroth operand is either assignable or a table or an rtable.
- It is of type function and its zeroth operand is assignable.
type⁡x0⁡4,assignable
true
x0⁡4≔7
type⁡x0,assignable⁡name
type⁡f⁡x,assignable⁡name
false
type⁡true,assignable⁡name
See Also
type/function
type/indexed
type/name
type/rtable
type/symbol
type/table
Download Help Document