This section describes additional methods defined in the Dylan module that pertain to <machine-word>. Note that this section only describes extensions to the Dylan library; for complete descriptions, you should also refer to the Dylan Reference Manual.
Note that the Common Dylan library also has these extensions because it uses the Dylan library.
odd?Sealed Method
odd? (m :: machine-word) => _ :: booleaneven?
Sealed Method
even? (m :: machine-word) => _ :: booleanzero?
Sealed Method
zero? (m :: machine-word) => _ :: boolean
Sealed Method
positive? (m :: machine-word) => _ :: booleannegative?
Sealed Method
negative? (m :: machine-word) => _ :: boolean
These functions return a result based on interpreting m as a signed integer value.
Sealed Method
= (m1 :: machine-word, m2 :: machine-word) => _ :: boolean=
Sealed Method
= (i1 :: abstract-integer, m2 :: machine-word) => _ :: boolean=
Sealed Method
= (m1 :: machine-word, i2 :: abstract-integer) => _ :: boolean
The comparison is performed with the machine-word arguments interpreted as signed integer values.
<Sealed Method
< (m1 :: machine-word, m2 :: machine-word) => _ :: boolean<
Sealed Method
< (i1 :: abstract-integer, m2 :: machine-word) => _ :: boolean<
Sealed Method
< (m1 :: machine-word, i2 :: abstract-integer) => _ :: boolean
The comparison is performed with the machine-word arguments interpreted as signed integer values.
asSealed Method
as(t == <integer>, m :: machine-word) => _ :: integer
m when interpreted as a signed integer value. An error is signaled if the value of m cannot be represented as an instance of integer.
Sealed Method
as(t == <abstract-integer>, m :: machine-word) => _ :: abstract-integer
m when interpreted as a signed integer value.
Sealed Method
as(t == <machine-word>, i :: abstract-integer) => _ :: machine-word
i is outside the machine word range, then the result consists of the low $machine-word-size bits of the twos-complement representation of i. If any of the discarded bits differ from the sign of i, then an error is signaled.
Sealed Method
limited(t == <machine-word>,
#key signed? :: boolean,
min :: machine-word, max :: machine-word)
=> _ :: type
If the signed? argument is true (the default) then the min and max arguments are interpreted as signed values. When signed? is false, the min and max arguments are interpreted as unsigned values. The default value for each of min and max depends on the value of signed?. The defaults are taken from the corresponding minimum and maximum machine word values (see $maximum-signed-machine-word and related constants below).
For convenience, the values of min and/or max may also be instances of <abstract-integer>, in which case they are coerced to instances of <machine-word> as if by using as.