This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: consecutive 'let


Glad to help.  Incidentally, I just want to make sure you're aware of
let*, which is 'consecutive let', meaning that let variables can be
used in later let variables' expressions (if they all need to access
each other use letrec).  Also, set! technically isn't necessary here -
you can just initialize those values in the let expression (in which
case the first expression in the dynamic-wind could just be (lambda ()
#t) because it doesn't have to do anything.  I've never understood why
dynamic-wind includes a 'before' function - maybe someone can
enlighten me.

An example of let*:

(let* ((x 1)
          (y (+ x 1))
  y)

will return 2

but

(let ((x 1)
        (y (+ x 1)))
  y)

will throw an error, because x doesn't exist in the scope of y's
initialization expression.

Perhaps you knew all that, just including it for completeness.

- Jake


On Dec 26, 2007 5:46 PM, Yaroslav Kavenchuk <kavenchuk@gmail.com> wrote:
> Oops, (ret ()) not need :)
>
> Many thanks again!
>
> --
> WBR, Yaroslav Kavenchuk.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]