[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Order of the evaluation of elements in a quasiquote list.
From: |
Kjetil Svalastog Matheussen |
Subject: |
Re: Order of the evaluation of elements in a quasiquote list. |
Date: |
Sun, 3 Apr 2005 14:09:15 +0200 (CEST) |
On Sun, 3 Apr 2005 address@hidden wrote:
> On Sun, Apr 03, 2005 at 01:38:04PM +0200, Kjetil Svalastog Matheussen wrote:
> > On Sun, 3 Apr 2005, Neil Jerram wrote:
> >
> > > Kjetil Svalastog Matheussen wrote:
> > > > Hi, I have recently stumbled upon various bugs in my code
> > > > because the order of the evaluation of the elements in a quasiquote
> > > > list changes.
> > >
> > > Changes how? Can you give us an example, to make things concrete?
> > >
> >
> > Sorry, this is the stripped down version of the cause of the bug I'm
> > finding various places:
> >
> > (let ((a 1))
> > `( ,(begin (set! a 2) a)
> > ,a))
> > -> (2 1)
> >
> >
> > Wouldn't it be better if this one returned (2 2)?
>
> Why do you think that "(2 2)" would be _better_? (How do you define
> "better" ?)
It just feels more logical, left to right, top to bottom.
Thanks for the information, I had a small hope
that this was a bug in guile, or that the behaviour could be
changed with a switch. I'll fix up my code.
--