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!


Ricky <rickythesk8r@earthlink.net> writes:

> It may not be a bug, after all.
> 
> Whereas append! is usually defined as
> 
> (define (append! l1 l2)
>   (set-cdr! (last-pair l1) l2)
>   l1)
> 
> append is usually defined as
> 
> (define (append l1 l2)
>   (if (null? l1) l2
>        (cons (car l1)
>                   (append (cdr l1) l2))))
> 
> These definitions produce the results complained of.

These are not definitions in the sense that they define the meaning of
append.  They are only programming examples.  Scheme is defined by
R5RS.  The natural extension of R5RS append into append! has the same
requirements on its args as append, i.e., both append and append!
should generate an error on other arguments than lists.

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