Issue #209 - Starting SRFI 143

This commit is contained in:
Justin Ethier 2017-08-07 16:37:51 +00:00
parent 464a9e4195
commit c45aa16b30

View file

@ -17,7 +17,8 @@
;fxzero? fxpositive? fxnegative? fxodd? fxeven? ;fxzero? fxpositive? fxnegative? fxodd? fxeven?
;fx= fx< fx> fx<= fx>= ;fx= fx< fx> fx<= fx>=
;fxmax fxmin ;fxmax fxmin
;fx+ fx- fx* fx+
;fx- fx*
;fxabs fxsquare fxsqrt fxexpt ;fxabs fxsquare fxsqrt fxexpt
;fx+/carry ;fx+/carry
;fx-/carry ;fx-/carry
@ -51,6 +52,13 @@
;fxfold fxfor-each fxunfold ;fxfold fxfor-each fxunfold
;fxlogical-shift ;fxlogical-shift
) )
(inline
fx-width
fx-greatest
fx-least
fixnum?
fx+
)
(begin (begin
(define (fx-width) 31) (define (fx-width) 31)
(define (fx-greatest) 1073741823) (define (fx-greatest) 1073741823)
@ -59,5 +67,11 @@
"(void *data, int argc, closure _, object k, object obj)" "(void *data, int argc, closure _, object k, object obj)"
" return_closcall1(data, k, " return_closcall1(data, k,
obj_is_int(obj) ? boolean_t : boolean_f); ") obj_is_int(obj) ? boolean_t : boolean_f); ")
(define-c fx+
"(void *data, int argc, closure _, object k, object i, object j)"
" Cyc_check_fixnum(data, i);
Cyc_check_fixnum(data, j);
object result = obj_int2obj(obj_obj2int(i) + obj_obj2int(j));
return_closcall1(data, k, result); ")
)) ))