|Re: Scheme is not another C-like language? was Compilers :) email@example.com (George Neuner) (2023-01-12)|
|Re: Scheme is not another C-like language? was Compilers :) firstname.lastname@example.org (Nils M Holm) (2023-01-12)|
|From:||Nils M Holm <email@example.com>|
|Date:||Thu, 12 Jan 2023 11:15:25 +0100|
|Injection-Info:||gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="12337"; mail-complaints-to="firstname.lastname@example.org"|
|Posted-Date:||12 Jan 2023 13:39:26 EST|
Kaz Kylheku <email@example.com> wrote:
> I tried (lambda () (define x 42) (define x 43)) in a Scheme
> implementation and got an error about the duplicate variable.
> That's completely silly since it breaks the idea that the block scoped
> define can just be desugared to nested lets.
If I am not completely mistaken, local DEFINE expands to LETREC
and not to nested LET, so your example would result in two
instances of X in the same scope:
(letrec ((x 42)
Nils M Holm < n m h @ t 3 x . o r g > http://t3x.org
[See the more complete analysis just posted. -John]
Return to the
Search the comp.compilers archives again.