Handbook
Glossary
define-integer-ops ( word fix-word big-word -- )
Vocabulary
math
.
partial-dispatch
Inputs
word
a
word
fix-word
a
word
big-word
a
word
Outputs
None
Word description
Defines an integral arithmetic operation. 'word' is the generic word, 'fix-word' the word to dispatch on if the last argument is a
fixnum
and 'big-word' thew ord if it is a
bignum
.
Definition
USING:
arrays
assocs
kernel
make
math
words
;
IN:
math.partial-dispatch
:
define-integer-ops
( word fix-word big-word -- )
[
rot
[
fixnum
fixnum
3array
"derived-from"
set-word-prop
]
[
bignum
bignum
3array
"derived-from"
set-word-prop
]
bi-curry
bi*
]
[
[
integer-op-triples
]
2dip
[
define-integer-op-words
]
[
2drop
[
dup
integer-op-word
]
map>alist
%
]
3bi
]
3bi
;