chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Named let*


From: Patrick Li
Subject: Re: [Chicken-users] Named let*
Date: Wed, 29 May 2013 06:53:35 -0700

If I understand the OP correctly, he wants let* to imitate this macro.

(define-syntax named-let*
  (syntax-rules ()
    ((named-let* name ((var val) ...)
        body ...)
     (let* ((var val) ...)
       (let name ((var var) ...)
         body ...)))))

  -Patrick


On Wed, May 29, 2013 at 5:47 AM, Jörg F. Wittenberger <address@hidden> wrote:
On May 27 2013, Michele La Monaca wrote:

R5RS doesn't  specify this kind of syntax (nor Chicken supports it):

(let* loop ((a <init>) (b a))
  <body>)

To me it seems a missing piece of syntax. Am I wrong?

I've missed it occasionally as well, but I'm not sure it's *that* useful.

Of course that's something we all can live without, but let me expose
a concrete example just for reference.

So if I understood your intentions correctly you are
after a syntax

(let* loop ((a X) ...) BODY)

within BODY you want to *call* (loop P1 P2 ...) and have P1, P2 ...
evaluated left-to-right?

If so, better forget it!  (Otherwise forget the rest of this mail).

There is a good reason, why this is not implemented anywhere:
LET is syntax, it's not a value bound to any variable.
the "loop" defined by a named let is an ordinary first class
procedure.  Parameters to procedures are evaluated in an unspecified
order.

In order to make your example work, you wold need LOOP to become
syntax... thus you could not pass by value to any other procedure
anymore.


...........









_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]