Re: Do people dislike parentheses or the conceptual mismatch with trees?
- From: Raffael Cavallaro <raffaelcavallaro@pas-d'espam-s'il-vous-plait-mac.com>
- Date: Wed, 17 Oct 2007 11:51:59 -0400
On 2007-10-17 04:04:35 -0400, Ville Oikarinen <ville@xxxxxxxxxxxxx> said:
anonymous:
(green yellow)
named:
favorite-colors {green yellow}
named:
(defparameter *favorite-colors* (list 'green 'yellow))
named:
(let ((favorite-colors (list 'green 'yellow))
(favorite-days (list 'saturday 'sunday))
...
named:
? (defparameter *favorites-list*
(list '(favorite-colors . (green yellow))
'(favorite-things . (whiskers-on-kittens warm-woolen-mittens))))
*FAVORITES-LIST*
? (first (cdr (assoc 'favorite-things *favorites-list*)))
WHISKERS-ON-KITTENS
? (second (cdr (assoc 'favorite-things *favorites-list*)))
WARM-WOOLEN-MITTENS
?
or:
? (loop with favorite-colors = (list 'green 'yellow)
with favorite-things =
(list 'whiskers-on-kittens 'warm-woolen-mittens)
with all-favorites = (append favorite-colors favorite-things)
for element in all-favorites do
(format t "~a is one of my favorites.~%" element))
GREEN is one of my favorites.
YELLOW is one of my favorites.
WHISKERS-ON-KITTENS is one of my favorites.
WARM-WOOLEN-MITTENS is one of my favorites.
NIL
?
or:
(favorite-colors (green yellow) favorite-things (whiskers-on-kittens ...
where *your* program interprets this list structure as named lists.
You seem to keep missing the point that there is no "objective" interpretation of list data in lisp. Your program is free to interpret it any way you like. Saying that lisp lists are "anonymous" just means that *you* have been interpreting them anonymously. If this is a problem for you then just stop doing it.
Lisp programmers interpret lists as named lists all the time (look at the association lists above, though I hesitate to suggest this lest you think it's the only way to do it - it's not). You can interpret lists as named lists in any number of ways.
Please also read Kent's reply down thread. I think he comes at it from a different angle but to the same end - i.e., that you think that your problems with your preferred uses for trees/lisp are why *others* don't like lisp.
.
- Follow-Ups:
- Re: Do people dislike parentheses or the conceptual mismatch with trees?
- From: Ville Oikarinen
- Re: Do people dislike parentheses or the conceptual mismatch with trees?
- From: Tim Bradshaw
- Re: Do people dislike parentheses or the conceptual mismatch with trees?
- References:
- Do people dislike parentheses or the conceptual mismatch with trees?
- From: Ville Oikarinen
- Re: Do people dislike parentheses or the conceptual mismatch with trees?
- From: Tim Bradshaw
- Re: Do people dislike parentheses or the conceptual mismatch with trees?
- From: Ville Oikarinen
- Do people dislike parentheses or the conceptual mismatch with trees?
- Prev by Date: Re: Common Lisp mentioned in a meaningless press blurb...
- Next by Date: Re: Do people dislike parentheses or the conceptual mismatch with trees?
- Previous by thread: Re: Do people dislike parentheses or the conceptual mismatch with trees?
- Next by thread: Re: Do people dislike parentheses or the conceptual mismatch with trees?
- Index(es):
Relevant Pages
|