[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: expression and definition context in Scheme
From: |
Damien Mattei |
Subject: |
Fwd: expression and definition context in Scheme |
Date: |
Mon, 29 Aug 2022 12:10:00 +0200 |
---------- Forwarded message ---------
From: Damien Mattei <damien.mattei@gmail.com>
Date: Mon, Aug 29, 2022 at 12:09 PM
Subject: Re: expression and definition context in Scheme
To: Maxime Devos <maximedevos@telenet.be>
yes , the same with 'while too, i will make it in my Scheme+ to allow inner
'define in those blocks without other stuff (in Scheme+ i had already a
simple macro : (& ev ...) = (let () ev ...) that replace 'begin when
'define is needed in blocks.
regards,
Damien
On Sun, Aug 28, 2022 at 11:30 AM Maxime Devos <maximedevos@telenet.be>
wrote:
> On 28-08-2022 08:40, Damien Mattei wrote:
>
> in fact my thought was not clear, perhaps just allow a 'define in an
> instructions as 'when in my example , 'define-ed variable would then be
> local one in the block of 'when, will it change something in scheme
> implementation in a bad way?
>
> Are you asking for 'when' to implicitly wrap its body in a (let () ...)?
>
> If so, that's trivial to implement, without changing the Scheme
> implementation:
>
> (define-syntax-rule (when cond exp ...)
> (if cond
> (let () exp ...)))
>
> Greetings,
> Maxime.
>
Re: expression and definition context in Scheme, Linus Björnstam, 2022/08/30