* The procedure member is now defined.

This commit is contained in:
Abdulaziz Ghuloum 2007-01-20 00:09:11 -05:00
parent c8111df150
commit a47856614f
3 changed files with 23 additions and 1 deletions

Binary file not shown.

View File

@ -880,6 +880,28 @@ reference-implementation:
(lambda (x ls)
(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
(letrec ([race

View File

@ -88,7 +88,7 @@
time-it
posix-fork fork waitpid env environ
pretty-print
even? odd?
even? odd? member
))
(define system-primitives