guile-devel
[Top][All Lists]
Advanced

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

Re: Add internal definitions to derived forms


From: Lassi Kortela
Subject: Re: Add internal definitions to derived forms
Date: Fri, 18 Nov 2022 12:22:09 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

Not quite. Guile extends the lambda body (and by extension let-forms) to allow 
mixed definitions and expressions:

(lambda ()
   (display "Heippa!")
   (define routsi #t)
   (and (read) routsi))

which expands to, more or less, a letrec*. All in accordance to the paper 
fixing letrec(reloaded).

Thus saying that the cond clause body is like a lambda body is probably the 
simplest way to express it.

R7RS defines the syntax of `let` et.al. as follows (section 3.5):

(let (<binding spec>*) <tail body>)

Where:

<tail body> = <definition>* <tail sequence>
<tail sequence> = <expression>* <tail expression>

So their definition of lambda:

(lambda <formals> <definition>* <expression>* <tail expression>)

could be abbreviated:

(lambda <formals> <tail body>)

I haven't read "Fixing letrec" but it looks like Guile intents to redefine <tail body> as follows:

<tail body> = <definition-or-expression>* <tail expression>
<definition-or-expression>* = <definition> | <expression>

R6RS appears to use <tail body> in the same sense as R7RS.



reply via email to

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