mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 00:37:35 +02:00
New version of (list?)
This commit is contained in:
parent
9eddbb812b
commit
2d9ba5a9e3
1 changed files with 6 additions and 10 deletions
|
@ -223,6 +223,7 @@
|
|||
negative?
|
||||
positive?
|
||||
zero?
|
||||
list?
|
||||
not
|
||||
string>=?
|
||||
string>?
|
||||
|
@ -706,16 +707,11 @@
|
|||
(define (newline . port)
|
||||
(apply write-char (cons #\newline port)))
|
||||
(define (not x) (if x #f #t))
|
||||
(define (list? o)
|
||||
(define (_list? obj)
|
||||
(cond
|
||||
((null? obj) #t)
|
||||
((pair? obj)
|
||||
(_list? (cdr obj)))
|
||||
(else #f)))
|
||||
(if (Cyc-has-cycle? o)
|
||||
#t
|
||||
(_list? o)))
|
||||
(define-c list?
|
||||
"(void *data, int argc, closure _, object k, object o)"
|
||||
" return_closcall1(data, k, Cyc_is_list(o));"
|
||||
"(void *data, object ptr, object o)"
|
||||
" return Cyc_is_list(o);")
|
||||
(define (zero? n) (= n 0))
|
||||
(define (positive? n) (> n 0))
|
||||
(define (negative? n) (< n 0))
|
||||
|
|
Loading…
Add table
Reference in a new issue