28 lines
576 B
Scheme
28 lines
576 B
Scheme
|
|
||
|
(library (ikarus fixnums)
|
||
|
(export fxzero? fxadd1 fxsub1)
|
||
|
(import
|
||
|
(only (scheme) $fxadd1 $fxsub1)
|
||
|
(except (ikarus) fxzero? fxadd1 fxsub1))
|
||
|
|
||
|
(define fxzero?
|
||
|
(lambda (x)
|
||
|
(cond
|
||
|
[(eq? x 0) #t]
|
||
|
[(fixnum? x) #f]
|
||
|
[else (error 'fxzero? "~s is not a fixnum" x)])))
|
||
|
|
||
|
(define fxadd1
|
||
|
(lambda (n)
|
||
|
(if (fixnum? n)
|
||
|
($fxadd1 n)
|
||
|
(error 'fxadd1 "~s is not a fixnum" n))))
|
||
|
|
||
|
(define fxsub1
|
||
|
(lambda (n)
|
||
|
(if (fixnum? n)
|
||
|
($fxsub1 n)
|
||
|
(error 'fxsub1 "~s is not a fixnum" n))))
|
||
|
|
||
|
)
|