* The procedure member is now defined.
This commit is contained in:
parent
c8111df150
commit
a47856614f
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -880,6 +880,28 @@ reference-implementation:
|
||||||
(lambda (x ls)
|
(lambda (x ls)
|
||||||
(race ls ls ls x))))
|
(race ls ls ls x))))
|
||||||
|
|
||||||
|
(primitive-set! 'member
|
||||||
|
(letrec ([race
|
||||||
|
(lambda (h t ls x)
|
||||||
|
(if (pair? h)
|
||||||
|
(if (equal? ($car h) x)
|
||||||
|
h
|
||||||
|
(let ([h ($cdr h)])
|
||||||
|
(if (pair? h)
|
||||||
|
(if (equal? ($car h) x)
|
||||||
|
h
|
||||||
|
(if (not (eq? h t))
|
||||||
|
(race ($cdr h) ($cdr t) ls x)
|
||||||
|
(error 'member "circular list ~s" ls)))
|
||||||
|
(if (null? h)
|
||||||
|
'#f
|
||||||
|
(error 'member "~s is not a proper list" ls)))))
|
||||||
|
(if (null? h)
|
||||||
|
'#f
|
||||||
|
(error 'member "~s is not a proper list" ls))))])
|
||||||
|
(lambda (x ls)
|
||||||
|
(race ls ls ls x))))
|
||||||
|
|
||||||
|
|
||||||
(primitive-set! 'list->string
|
(primitive-set! 'list->string
|
||||||
(letrec ([race
|
(letrec ([race
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
time-it
|
time-it
|
||||||
posix-fork fork waitpid env environ
|
posix-fork fork waitpid env environ
|
||||||
pretty-print
|
pretty-print
|
||||||
even? odd?
|
even? odd? member
|
||||||
))
|
))
|
||||||
|
|
||||||
(define system-primitives
|
(define system-primitives
|
||||||
|
|
Loading…
Reference in New Issue