This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Patch for append!
- To: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Subject: Re: Patch for append!
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Mon, 24 Jan 2000 16:08:44 +0100 (MET)
- cc: Guile Mailing List <guile at sourceware dot cygnus dot com>, djurfeldt at nada dot kth dot se
On 21 Jan 2000, Mikael Djurfeldt wrote:
> Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
>
> > Then we need a fix, right? :-)
>
> I'm sorry for fooling you like this. As you might have seen, we've
> now discovered that SRFI-1 suggests an append! which can take an
> improper list or atom as last arg. So, while inconsistent, Guile's
> old behaviour is what we want to have.
You didn't fool me: It's not about an improper list as a _last_ argument,
but rather about an improper list as an intermediate argument.
Example: Without my patch guile would evaluate (append! '(1 . 2) 3) to
'(1 3), thus overwriting the '2'. This is in contrast to the behaviour of
append, which will throw an error if anything but the last argument is not
a proper list.
My patch only makes sure that _intermediate_ improper lists result in an
error. The last parameter may be anything, which is exaclty how append
handles this case.
Best regards,
Dirk Herrmann