mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
Issue #367 - Allow list-copy to return non-lists
This commit is contained in:
parent
fcf6b04e78
commit
380641ddda
1 changed files with 6 additions and 2 deletions
|
@ -808,8 +808,12 @@
|
|||
'()
|
||||
(cons obj (make (- n 1) obj) )))))
|
||||
(make k x)))
|
||||
(define (list-copy lst)
|
||||
(foldr (lambda (x y) (cons x y)) '() lst))
|
||||
(define (list-copy ls)
|
||||
(let lp ((ls ls) (res '()))
|
||||
(if (pair? ls)
|
||||
(lp (cdr ls) (cons (car ls) res))
|
||||
(append (reverse res) ls))))
|
||||
|
||||
;; Implementation of receive from SRFI 8
|
||||
(define-syntax receive
|
||||
(er-macro-transformer
|
||||
|
|
Loading…
Add table
Reference in a new issue