The Big-Integers library extends the functionality of specific constructors in the Dylan library as follows:
limitedG.f. method
limited abstract-integer-class #key min max => limited-type
<abstract-integer>, whose instances are integers greater than or equal to min (if specified) and less than or equal to max (if specified). If no keyword arguments are specified, the result type is equivalent to <abstract-integer>. The argument abstract-integer-class is the class <abstract-integer>.
<integer>, then the result type is equivalent to calling limited on <integer> with those same bounds.
The Limited Integer Type Protocol is extended to account for limited <abstract-integer> types.
This is true if and only if ... | ... all these clauses are true |
|---|---|
instance? (x, limited(<abstract-integer>, min: y, max: z)) | instance?(x, <abstract-integer>) (y <= x) (x <= z) |
| instance? (x, limited(<abstract-integer>, min: y)) | instance?(x, <abstract-integer>) (y <= x) |
| instance? (x, limited(<abstract-integer>, max: z)) | instance?(x, <abstract-integer>) (x <= z) |
| subtype? (limited(<abstract-integer>, min: w, max: x), limited(<abstract-integer>, min: y, max: z)) | (w >= y) (x <= z) |
| subtype? (limited(<abstract-integer>, min: w ...), limited(<abstract-integer>, min: y)) | (w >= y) |
| subtype? (limited(<abstract-integer>, max: x ...), limited(<abstract-integer>, max: z)) | (x <= z) |
This is type equivalent to ... | ... this, if and only if ... | ... this is true |
|---|---|---|
limited (<abstract-integer>, min: y, max: z) | limited (<integer>, min: y, max: z) |
|
limited (<abstract-integer>, min: y, max: $maximum-integer) | limited (<integer>, min: y) |
|
limited (<abstract-integer>, min: $minimum-integer, max: z) | limited (<integer>, max: z) |
|
Type disjointness is modified as follows to account for limited <abstract-integer> types.
<integer> and the range of the limited integer type is disjoint from the range of <integer> (that is, from $minimum-integer to $maximum-integer).