enable R5RS map' & for-each' (i.e., mmap' and mfor-each') inlining

original commit: 4b1f74671429f6d8955c6afa98569821fec9e8c7
This commit is contained in:
Matthew Flatt 2011-12-16 09:33:30 -07:00
parent 5a80a3b6e4
commit d2112c9652

View File

@ -1,6 +1,7 @@
#lang scheme/base
(require (for-syntax scheme/base))
(require (for-syntax scheme/base)
"performance-hint.rkt")
(provide mmap
mfor-each
@ -23,6 +24,7 @@
list->mlist
mlistof)
(begin-encourage-inline
(define mmap
(case-lambda
[(f l) (let loop ([l l])
@ -56,7 +58,7 @@
(cond
[(null? l) (void)]
[else (apply f (mcar l) (map mcar ls))
(loop (mcdr l) (map mcdr ls))]))]))
(loop (mcdr l) (map mcdr ls))]))])))
(define (list->mlist l)
(cond