replace list-copy and make-list impls by scheme with ones by C

This commit is contained in:
Yuichi Nishiwaki
2014-01-22 22:37:27 +09:00
parent b3529112c0
commit 5dd66cbcd1
3 changed files with 51 additions and 16 deletions
+1 -16
View File
@@ -445,20 +445,6 @@
;;; 6.4 Pairs and lists
(define (make-list k . args)
(if (null? args)
(make-list k #f)
(if (zero? k)
'()
(cons (car args)
(make-list (- k 1) (car args))))))
(define (list-copy obj)
(if (null? obj)
obj
(cons (car obj)
(list-copy (cdr obj)))))
(define (memq obj list)
(if (null? list)
#f
@@ -503,8 +489,7 @@
(car list)
(assoc obj (cdr list) compare)))))
(export make-list list-copy
memq memv member
(export memq memv member
assq assv assoc)
;;; 6.5. Symbols