[racket] Little Schemer, lat?
2015-01-02 23:58 GMT+01:00 Frank Weytjens <fweytjens.android at gmail.com>:
> Happy new year Racketeers,
> An empty list is a list, but is it a lat ?
> If you give an empty list as argument to the lat?-function, the answer is
> yes. But an atom must be a string of characters or numbers, or even one
> character, or a combination of special characters as long as it is not an (
> or an ). The empty list contains no characters at all, so it can not be a
> list of atoms.
> Then an empty list can be anything.
To some degree it is a matter of convention. This illustrates the
usual convention:
Is this is a list of (person) names?
Alice, Bob, Charlie
Yes, all items on the list are names.
Is this a list of names?
Alice, Bob, Cat
No, since Cat is not a name.
Is this (the empty list) a list of names?
<nothing>
Yes, there are no non-names on the list.
In other words all items on the list are names, which makes it a list of names.
The empty list is also a list of cheeses.
--
Jens Axel Søgaard