[plt-scheme] HTDP Excercise 14.1.5
2009/6/12 aditya shukla <adityashukla1983 at gmail.com>:
> Thanks I got it now.I have one question though , in the documentation of
> append it is given that
>
> (append lst ...) → list?
> lst : list?
> (append lst ... v) → any/c
> lst : list?
> v : any/c
>
> When given all list arguments, the result is a lists that contains all of
> the elements of the given lists in order. The last argument is used directly
> in the tail of the result.
>
> The last argument need not be a list, in which case the result is an
> "improper list.
>
>
> Can someone please explain what does an improper list means?
>
> Aditya
An improper list is a list terminated by a value other than empty.
Some examples follow.
Proper lists:
empty
(cons 3 empty)
(cons 2 (cons 3 empty))
(cons 1 (cons 2 (cons 3 empty)))
Improper lists:
3
(cons 2 3)
(cons 1 (cons 2 3))
--
Carl Eastlund