Changes between Version 97 and Version 98 of IR2
- Timestamp:
- 05/13/21 15:04:47 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR2
v97 v98 247 247 * Comparisons likes `==` and `<` return a `$bool` (not an int, like C). 248 248 * Every object holds a value of its declared type, always. There is no notion of "trap representation", as in C. 249 * Evaluation of an expression always results in a value of the type of that expression s. There are no "exceptions".249 * Evaluation of an expression always results in a value of the type of that expression. There are no "exceptions". 250 250 * For some operations, the result of applying the operation on certain inputs in unspecified. We say those applications are "unsafe". The result of an unsafe operation is unspecified, but will result in some value of the appropriate type. If an application is not unsafe, it is "safe". 251 251 * For every operation, there is a way to determine if performing that operation is safe. Hence an assertion on a certain expression can be checked before performing the operation. Examples: 252 * `a+b`, for the $int, $real, or float types: always safe 252 * `a+b`, for the $int, $real, or float types: always safe, assuming `a` and `b` are defined. Will will assume all objects are defined from now on. 253 253 * `a/b`: `b!=0` 254 254 * `p+i` (pointer arithmetic): `$summable(p, i)`
