[racket] Little Schemer, lat?

From: Frank Weytjens (fweytjens.android at gmail.com)
Date: Wed Jan 7 14:49:37 EST 2015

2015-01-03 21:26 GMT+01:00 Matthew Butterick <mb at mbtype.com>:

> > The empty list is also a list of cheeses.
>
> Further down that road, I was a tiny bit surprised recently to discover
> that `andmap` returns true for any predicate when the input list is empty
> [1], but then I saw how it's a natural consequence of this principle. Empty
> is a member of every list, thus empty can never test false.
>
>
> [1]
> http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._andmap%29%29
>
>
>
>
> On Sat, Jan 3, 2015 at 11:34 AM, Jens Axel Søgaard <jensaxel at soegaard.net>
> wrote:
>
>> 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
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>


Hello,

This is my point of view:

TLS tell's us to ad this definition to work with Scheme

(define atom?
   (lambda (x)
       (and (not (pair? x)) (not (null? x)))))

it also say's that the empty list ()  is a list.

Now how can the empty list, that contains nothing at all, be of any type?
In my opinion it is the type of thing you put in it that defines the type
of list.
Calling an empty list a list of a certain type, can only be done by
definition and the only advantage is that recursion over a list is much
easier.

If you look at the definition of an atom, you see that calling an empty
list a list of atoms is a violation of the definition of an atom, because
the atom can not be null and the empty list is null.

Let me put it differently. Is an empty bag an empty bag of oranges or an
empty bag of lemons? You may say both. I understand that an empty bag may
contain anything, but isn't it redundant to call it more than just an empty
bag?

Suppose i write a note with 'i owe myself one million $' and put this note
in my wallet. Does this make me a millionaire?
Or do i have an empty million wallet?

Then why bother about how was the universe created? Just pick some answer
out of my empty bag of universe creations.

Who is God ---> '()

Greetings

Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150107/b1a27cab/attachment.html>

Posted on the users mailing list.