Re: Efficiency of `map`

2017-06-09 Thread Mark H Weaver
Stefan Monnier writes: >> (define (map f l) >> (if (pair? l) >> (cons (f (car l)) >> (map f (cdr l))) >> '())) >> >> whereas we used to have to write code like this in order to support long >> lists without overflowing the stack: >> >> (define (map f l) >>

Re: Efficiency of `map`

2017-06-09 Thread Nala Ginrut
Hi Mark! Do you have any advice to optimize it without disable GC temperaly? Or the only way is to change a better GC? 2017年6月10日 12:28,"Mark H Weaver" 写道: > Stefan Monnier writes: > > >> (define (map f l) > >> (if (pair? l) > >> (cons (f (car l)) > >> (map f (cdr l))