[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: returning a freshly allocated list?
| From: "Chongkai Zhu" <czhu@xxxxxxxxxxx>
| Date: Sun, 8 Apr 2007 18:32:48 -0600
| According to the specification, merge should return a *freshly*
| *allocated* list as its result.
| But the reference implementation is:
| (define (merge a b less? . opt-key)
| (define key (if (null? opt-key) identity (car opt-key)))
| (cond ((null? a) b)
| ((null? b) a)
| ...which is trying to avoid allocating as much as possible.
| Solution: either remove the "freshly allocated" requirement in the
| specification, or to use (map identity lst) where needed in the
| reference implementation.
SRFI-Editors: Please remove the words "freshly allocated" from