[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rec



I understand perfectly well what you can do with REC.  What I disagree
with is precisely the usage that you are advocating.  It is hard to
explain, once your example has been shown, why things like
(rec list-of-as (cons 'a list-of-as))
don't work, and any explanation will seem like a "cop-out".  I'd much
rather say that the only essential behavior is when beta is a
lambda-expression, and let individual implementations do whatever they
please.

A similar objection (with which I agree) was raised against internal
DEFINE.  The simplest (only?) way to guarantee that a procedure with
internal DEFINEs behaves as if they were all done in parallel is to
disallow anything but procedural DEFINEs internally.  While the
implementation may allow for further "fancy" manipulations, requiring
them in the standard only opens a whole new can of worms.

Since I disagree that (rec box
                         (cons a (lambda ()
                                    (let ([v b])
                                       (set-car! box (lambda () v))
                                       v)))

should work in the standard, I see no difference between REC and
NAMED-LAMBDA.