Name | cast
|
Definition | cast : overloaded.
cast(T2:type,X:val(T1:type)) : expr(T2).
cast(T2:type,X:var(T1:type)) : var(T2).
|
Example | cast(int,true)
|
Defined in | ops.l
|
Implementation | icode
|
Description | Cast an expression to another type. The new type's representation must have the same size as the original type else a run time error occurs. The overloaded declarations mean that if a variable is cast a variable is returned, so a cast expression can be used as the left hand side of an assignment.
|
Note | Do not try to cast to or from a string - this won't do what you want. To convert a character to a string, use c2s.
|