mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15: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)))
|
||||
|
||||
(define (primitive-procedure-names)
|
||||
(map car
|
||||
primitive-procedures))
|
||||
(foldr
|
||||
(lambda (x y)
|
||||
(cons (car x) y))
|
||||
'()
|
||||
primitive-procedures))
|
||||
|
||||
(define (primitive-procedure-objects)
|
||||
(map (lambda (proc) (list 'primitive (cadr proc)))
|
||||
primitive-procedures))
|
||||
(foldr
|
||||
(lambda (proc rest)
|
||||
(cons (list 'primitive (cadr proc)) rest))
|
||||
'()
|
||||
primitive-procedures))
|
||||
|
||||
(define (apply-primitive-procedure proc args)
|
||||
(apply ;apply-in-underlying-scheme
|
||||
|
|
Loading…
Add table
Reference in a new issue