|
From: | Stefan Israelsson Tampe |
Subject: | Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses |
Date: | Sat, 5 Feb 2022 18:31:51 +0100 |
Hi,
> > (define foo 'bar) ;; <--- ^^^
> > (define-syntax foobar
> > (syntax-rules (foo)
> > ((_ foo)
> > (begin (pk "it's a foo!") foo))
> > ((_ goo)
> > (begin (pk "it's not a foo ...") goo))))
> >
> > (define (zebra stripes)
> > (if stripes
> > (define foo 'quux)) ;; <--- ###
> > (foobar foo)) ;; <--- ***
Stefan Israelsson Tampe schreef op za 05-02-2022 om 02:14 [+0100]:
> For conditional variables you gave a default value.
I don't understand the question, I didn't give a default value?
The variable 'foo' (^^^) is a different variable from 'foo' (###)
since 'foo' (^^^) is a module variable, and 'foo' (###) is a local
variable in 'zebra'. Merely having the same name does not imply
being the same variable, c.f. shadowing, so '^^^' does _not_ give
a default value to the 'foo' in '###'.
(If '###' was 'set!' instead of 'define', then the two variables would
have been the same.)
> So then why on earth do you not have an implicit let ?
> There must be a good reason.
I don't understand the question, there's an implicit 'let' here:
the definition of 'zebra'. Also, I don't see what the question ‘why do
you not have an implicit let?’ has to do with ‘For conditional
variables you gave a default value.’.
Also, AFAICT these questions don't seem to have anything to do
with the macro system problems I noted?
Greetings,
Maxime.
[Prev in Thread] | Current Thread | [Next in Thread] |