Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3315 > unrolled thread

Re: Scheme is not another C-like language? was Compilers :)

Started byNils M Holm <nmh@t3x.org>
First post2023-01-12 11:15 +0100
Last post2023-01-12 11:15 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.compilers


Contents

  Re: Scheme is not another C-like language? was Compilers :) Nils M Holm <nmh@t3x.org> - 2023-01-12 11:15 +0100

#3315 — Re: Scheme is not another C-like language? was Compilers :)

FromNils M Holm <nmh@t3x.org>
Date2023-01-12 11:15 +0100
SubjectRe: Scheme is not another C-like language? was Compilers :)
Message-ID<23-01-047@comp.compilers>
Kaz Kylheku <864-117-4973@kylheku.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:

(lambda ()
  (letrec ((x 42)
           (x 43))))

--
Nils M Holm  < n m h @ t 3 x . o r g >  http://t3x.org
[See the more complete analysis just posted. -John]

[toc] | [standalone]


Back to top | Article view | comp.compilers


csiph-web