Re: SRFI-1 round 3 discussion Sergei Egorov (29 Jun 1999 06:28 UTC)
Improper lists [Was: SRFI-1 round 3 discussion] sperber@xxxxxx (29 Jun 1999 07:35 UTC)
Re: Improper lists [Was: SRFI-1 round 3 discussion] Lars Thomas Hansen (29 Jun 1999 14:09 UTC)
Re: Improper lists Olin Shivers (29 Jun 1999 15:23 UTC)
Re: Improper lists Marc Feeley (29 Jun 1999 15:42 UTC)

Re: Improper lists Marc Feeley 29 Jun 1999 15:42 UTC

>    >    (let recur ((x x))
>    >      (if (pair? x)
>    >          (cons (car x) (recur (cdr x)))
>    >          y))
>
>    But this borders on the absurd, because under this definition,
>
>       (append '(a b c . d) '(e f g)) => (a b c e f g)
>
>    that is, the d is silently dropped.  What kind of sense does that make?
>
> Plenty of sense -- the D isn't doing anything except terminating that
> list. Once you get used to thinking of D as an empty list, Lars, you're going
> to love it.

I agree with Lars et al.  An improper list is not a list!!!  If someone
wants to mix them, explicit conversions should be performed.  In the
early days Gambit's append (and other functions) silently treated
non-pairs as the empty list as in

       (append '(a b c . d) '(e f g)) => (a b c e f g)

but some people complained that this did not help them catch errors
early in their programs.  Now I have tightened up the type checks to
signal an error.

Marc