projects
/
scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ea42a3
)
Fix flat-map
author
Luke Lau
<luke_lau@icloud.com>
Sun, 4 Aug 2019 18:09:40 +0000
(19:09 +0100)
committer
Luke Lau
<luke_lau@icloud.com>
Sun, 4 Aug 2019 18:09:40 +0000
(19:09 +0100)
ast.scm
patch
|
blob
|
history
diff --git
a/ast.scm
b/ast.scm
index 23e7723cc725a3a07b2fe5229576b92e604c34b2..1a4afe21f3258d829c4f305ea78fd2f804cca2ad 100644
(file)
--- a/
ast.scm
+++ b/
ast.scm
@@
-120,7
+120,7
@@
(append (range s (- n 1))
(list (+ s (- n 1))))))
-(define (flat-map f . xs) (fold-left append '() (
map f xs
)))
+(define (flat-map f . xs) (fold-left append '() (
apply map (cons f xs)
)))
(define (repeat x n) (if (<= n 0) '()
(cons x (repeat x (- n 1)))))