* moved weak-cons to ikarus.pairs
* moved weak-pair? to ikarus.predicates
This commit is contained in:
parent
24ce3f42ca
commit
5150058773
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -211,15 +211,6 @@
|
|||
|
||||
|
||||
|
||||
(primitive-set! 'weak-cons
|
||||
(lambda (a d)
|
||||
(foreign-call "ikrt_weak_cons" a d)))
|
||||
|
||||
(primitive-set! 'weak-pair?
|
||||
(lambda (x)
|
||||
(and (pair? x)
|
||||
(foreign-call "ikrt_is_weak_pair" x))))
|
||||
|
||||
(primitive-set! 'pointer-value
|
||||
(lambda (x)
|
||||
(pointer-value x)))
|
||||
|
|
|
@ -2,17 +2,22 @@
|
|||
|
||||
(library (ikarus pairs)
|
||||
(export
|
||||
cons set-car! set-cdr!
|
||||
cons weak-cons set-car! set-cdr!
|
||||
car cdr caar cdar cadr cddr caaar cdaar cadar cddar caadr cdadr
|
||||
caddr cdddr caaaar cdaaar cadaar cddaar caadar cdadar caddar
|
||||
cdddar caaadr cdaadr cadadr cddadr caaddr cdaddr cadddr cddddr)
|
||||
(import
|
||||
(only (ikarus) define if lambda pair? error quote let unless)
|
||||
(only (ikarus) define if lambda pair? error quote let unless
|
||||
foreign-call)
|
||||
(rename (only (scheme) cons $car $cdr $set-car! $set-cdr!)
|
||||
(cons sys:cons)))
|
||||
|
||||
(define cons (lambda (x y) (sys:cons x y)))
|
||||
|
||||
(define weak-cons
|
||||
(lambda (a d)
|
||||
(foreign-call "ikrt_weak_cons" a d)))
|
||||
|
||||
(define set-car!
|
||||
(lambda (x y)
|
||||
(unless (pair? x)
|
||||
|
|
|
@ -4,14 +4,15 @@
|
|||
(export fixnum? flonum? bignum? number? complex? real? rational?
|
||||
integer? exact? eof-object? bwp-object? immediate? boolean?
|
||||
char? vector? string? procedure? null? pair? symbol? not
|
||||
weak-pair?
|
||||
eq? eqv? equal?)
|
||||
|
||||
(import
|
||||
|
||||
(except (ikarus) fixnum? flonum? bignum? number? complex? real?
|
||||
rational? integer? exact? eof-object? bwp-object? immediate?
|
||||
boolean? char? vector? string? procedure? null?
|
||||
pair? symbol? not eq? eqv? equal?)
|
||||
boolean? char? vector? string? procedure? null?
|
||||
pair? weak-pair? symbol? not eq? eqv? equal?)
|
||||
(only (scheme) $fxadd1 $vector-ref $fx= $char= $string-ref
|
||||
$string-length $vector-length $car $cdr)
|
||||
(rename (only (ikarus) fixnum? flonum? bignum? eof-object?
|
||||
|
@ -91,6 +92,13 @@
|
|||
(define pair? (lambda (x) (sys:pair? x)))
|
||||
(define symbol? (lambda (x) (sys:symbol? x)))
|
||||
|
||||
|
||||
|
||||
(define weak-pair?
|
||||
(lambda (x)
|
||||
(and (pair? x)
|
||||
(foreign-call "ikrt_is_weak_pair" x))))
|
||||
|
||||
(define not (lambda (x) (if x #f #t)))
|
||||
|
||||
(define eq? (lambda (x y) (sys:eq? x y)))
|
||||
|
|
Loading…
Reference in New Issue