| 47 | === Numeric tower === |
| 48 | |
| 49 | `(numeric-tower ` ''identifier'' ...`)` |
| 50 | |
| 51 | The ''identifiers'' indicate the assumptions the library makes about the availability of different kinds of numbers. They may appear in any order, and have the following meanings: |
| 52 | |
| 53 | `exactness-preserving` |
| 54 | |
| 55 | The library relies on arithmetic operators other than `/` returning exact results when given exact arguments. |
| 56 | |
| 57 | `no-exactness-preserving` |
| 58 | |
| 59 | The library does not rely on arithmetic operators other than `/` returning exact results when given exact arguments. |
| 60 | |
| 61 | `ratios` |
| 62 | |
| 63 | The library relies on `/` returning exact results when given exact arguments. |
| 64 | |
| 65 | `no-ratios` |
| 66 | |
| 67 | The library does not rely on `/` returning exact results when given exact arguments. |
| 68 | |
| 69 | `inexact` |
| 70 | |
| 71 | The library relies on the availability of inexact numbers. |
| 72 | |
| 73 | `no-inexact` |
| 74 | |
| 75 | The library does not rely on the availability of inexact numbers. |
| 76 | |
| 77 | `complex` |
| 78 | |
| 79 | The library relies on the availability of non-real numbers. |
| 80 | |
| 81 | `no-complex` |
| 82 | |
| 83 | The library relies on the availability of non-real numbers. |
| 84 | |
| 85 | `exact-complex` |
| 86 | |
| 87 | The library does not rely on the availability of exact non-real numbers. |
| 88 | |
| 89 | `no-exact-complex` |
| 90 | |
| 91 | The library relies on the availability of exact non-real numbers. |
| 92 | |
| 93 | For example, the declaration `(no-exactness-preserving no-ratios inexact no-complex)` means that the library assumes only a limited range of exact integers, with numeric operations potentially overflowing to inexact reals. In consequence, it cannot run on an implementation that does not provide these features, and an implementation that provides non-integer exact numbers and non-real numbers may assume that these features are not used. |
| 94 | |
| 95 | It is an error to specify any other identifier. |
| 96 | |
| 97 | === Types === |
| 98 | |
| 99 | `(type ''identifier'' ''predicate'') |
| 100 | |
| 101 | The implementation may assume that ''identifier'' always has a value that will satisfy the predicate bound to ''predicate''. If `#t` appears instead of ''predicate'', any value will satisfy it, but the absence of a value will not. |
| 102 | |
| 103 | `(procedure-type ''identifier return-predicate arg-predicate'' ... `)` |
| 104 | |
| 105 | `(procedure-type ''identifier` ( `''return-predicate'' ...`) `''arg-predicate'' ... `)` |
| 106 | |
| 107 | The implementation may assume that ''identifier'' always has a value that is a procedure. When this procedure is invoked, its value satisfies the predicate bound to ''return-predicate'' (for the first format) or its values satisfy the predicates bound to the ''return-predicates'' (for the second format). In addition, its arguments (or an initial subsequence of them) satisfy the ''arg-predicates''. f `#t` appears instead of a predicate identifier, any value will satisfy it, but the absence of a value will not. |
| 108 | |
| 109 | '''Issue: This introduces phasing complications (where and when are the predicates bound?) which must be resolved as part of a comprehensive treatment of phasing.''' |
| 110 | |