mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-06 12:46:35 +02:00
Added (list?)
This commit is contained in:
parent
eae579bf32
commit
ef53201de5
1 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,12 @@
|
|||
(if (null? lst)
|
||||
end
|
||||
(func (car lst) (foldr func end (cdr lst)))))
|
||||
(define (list? obj)
|
||||
(cond
|
||||
((null? obj) #t)
|
||||
((pair? obj)
|
||||
(list? (cdr obj)))
|
||||
(else #f)))
|
||||
(define (list . objs) objs)
|
||||
(define (map func lst)
|
||||
(foldr (lambda (x y) (cons (func x) y)) '() lst))
|
||||
|
|
Loading…
Add table
Reference in a new issue