---------- Forwarded message ---------
From: Damien Mattei <damien.mat...@gmail.com>
Date: Mon, Aug 29, 2022 at 12:09 PM
Subject: Re: expression and definition context in Scheme
To: Maxime Devos <maximede...@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 <maximede...@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.
>

Reply via email to