This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for append!


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]