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

LetRec the way you want it IS in Common-lisp

    Date: Fri, 8 Apr 88 16:16:43 PDT
    From: James Rice <Rice@SUMEX-AIM.Stanford.EDU>

    Mmmm, I see what you're getting at.  Maybe it's a wimp-out
    but how about:

      It is an error to use the named structure in the definition
      of a letrec variable as an argument to a strict operator
      during the evaluation of its definition.

      e.g. (letrec ((foo (+ 1 foo)))   <---- error

	   (letrec ((bar (cons 42 bar)))   <--- ok.

In common-lisp you can get the reader to do this for you:

==> (prog1 nil (setf foo '#1=(a . #1#)))
==> (first foo)
==> (second foo)
==> (third foo)