| 262 | | * `cast(e,T)` : casts `e` to a value of the named type. `T` must name a subtype of the static type of `e`. |
| 263 | | * cast of integer to array-of-boolean, and vice-versa? |
| 264 | | * **Instead of casts would it be better to have explicit functions for each legal kind of cast?** |
| | 262 | * `cast(e,T)` : casts `e` to a value of the named type. |
| | 263 | * A cast can only take place when there is no change to the underlying value. It is only for changing the type. Example: one can cast from any integral type to another, but there might be an exception if the value is not in the range of the targeted type. One can cast any `Float` value to a `Real` value, but not the other way. (To convert from a `Real` to a `Float`, use, e.g., `round`.) If t1 is a subtype of t2, one can always cast from t1 to t2 (though this is rarely necessary, since an expression of type t1 can be used wherever one of type t2 is expected). |