Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread tomas
On Sun, Feb 06, 2022 at 10:45:54AM +0100, Linus Björnstam wrote: > You need to use ,optimize. Thanks you both, Maxime and Linus, for giving me a new lantern :) Cheers -- t signature.asc Description: PGP signature

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Linus Björnstam
You need to use ,optimize. -- Linus Björnstam On Sun, 6 Feb 2022, at 10:27, to...@tuxteam.de wrote: > On Sun, Feb 06, 2022 at 07:44:31AM +0100, Linus Björnstam wrote: >> >> On Sat, 5 Feb 2022, at 18:31, Stefan Israelsson Tampe wrote: >> > Hmm this was wrong, I mean >> > >> > For conditional

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Maxime Devos
to...@tuxteam.de schreef op zo 06-02-2022 om 10:27 [+0100]: > ...but doesn't "see" whether bindings are actually used (quite > possibly > those go away in a later optimisation phase, though): > > | scheme@(guile-user)> ,expand (let ((x 3)) (message #t "Yikes")) > | $3 = (let ((x 3)) (message #t

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread tomas
On Sun, Feb 06, 2022 at 07:44:31AM +0100, Linus Björnstam wrote: > > On Sat, 5 Feb 2022, at 18:31, Stefan Israelsson Tampe wrote: > > Hmm this was wrong, I mean > > > > For conditional variables we have a default begin. So then why on earth > > do you not have an implicit let?, Just laziness? >

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Stefan Israelsson Tampe
Hmm just why conditionals use begin and not let, On Sun, Feb 6, 2022 at 11:49 AM wrote: > On Sun, Feb 06, 2022 at 10:45:54AM +0100, Linus Björnstam wrote: > > You need to use ,optimize. > > Thanks you both, Maxime and Linus, for giving me a new lantern :) > > Cheers > -- > t >

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Maxime Devos
Stefan Israelsson Tampe schreef op zo 06-02-2022 om 21:13 [+0100]: > Hmm just why conditionals use begin and not let, I'd assume the reason is that this is how it has been done in the past and because of performance reasons (which don't seem to apply anymore?), so I guess that we could now switch

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Maxime Devos
Stefan Israelsson Tampe schreef op zo 06-02-2022 om 22:10 [+0100]: > I think you are right on this, I looked at the scheme spec and I find > no trace for using a let or not or not in the spec. > So it is an implementation detail. Now, this is important, if I want > to write portable code if cond

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Maxime Devos
Maxime Devos schreef op zo 06-02-2022 om 22:26 [+0100]: > FWIW, Guile already exports unportable syntax in (rnrs base): > R6RS doesn't mention named let anywhere, yet Guile exports it as > 'let' > in (rnrs base) anyway. Nevermind, R6RS has named let:

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread tomas
On Sun, Feb 06, 2022 at 09:28:15PM +0100, Maxime Devos wrote: > Stefan Israelsson Tampe schreef op zo 06-02-2022 om 21:13 [+0100]: > > Hmm just why conditionals use begin and not let, > > I'd assume the reason is that this is how it has been done in the past > and because of performance reasons

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses

2022-02-06 Thread Linus Björnstam
Historical garage maybe. I just remember some old bug in WebKit where let was a lot slower than var because it created what was called lexical context which affected interpreter speed because of some kind of linear time variable lookup. Anyway, that stuff doesn't apply to guile versions after