mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Replace maps with folds
This commit is contained in:
parent
c0afe8eef5
commit
2376694066
1 changed files with 10 additions and 4 deletions
|
@ -288,12 +288,18 @@
|
||||||
(list 'Cyc-display Cyc-display)))
|
(list 'Cyc-display Cyc-display)))
|
||||||
|
|
||||||
(define (primitive-procedure-names)
|
(define (primitive-procedure-names)
|
||||||
(map car
|
(foldr
|
||||||
primitive-procedures))
|
(lambda (x y)
|
||||||
|
(cons (car x) y))
|
||||||
|
'()
|
||||||
|
primitive-procedures))
|
||||||
|
|
||||||
(define (primitive-procedure-objects)
|
(define (primitive-procedure-objects)
|
||||||
(map (lambda (proc) (list 'primitive (cadr proc)))
|
(foldr
|
||||||
primitive-procedures))
|
(lambda (proc rest)
|
||||||
|
(cons (list 'primitive (cadr proc)) rest))
|
||||||
|
'()
|
||||||
|
primitive-procedures))
|
||||||
|
|
||||||
(define (apply-primitive-procedure proc args)
|
(define (apply-primitive-procedure proc args)
|
||||||
(apply ;apply-in-underlying-scheme
|
(apply ;apply-in-underlying-scheme
|
||||||
|
|
Loading…
Add table
Reference in a new issue