This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Patch for append!
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: Patch for append!
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 24 Jan 2000 16:52:59 +0100
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>, djurfeldt at nada dot kth dot se
- Cc: djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0001241605170.24470-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> On 21 Jan 2000, Mikael Djurfeldt wrote:
> > 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.
Yes, you're of course entirely right. Throughout this discussion I've
had the misconception that R5RS append doesn't accept an arbitrary
object as last argument, so I was very confused when SRFI-1 specified
this for append!.
But now I think everything is clear: both append and append! take
lists as arguments except for the last arg which may be arbitrary, and
everything is consistent and nice.
And, we'll apply your patch any time now.
Thanks,
/mdj