[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nopc -- Proposed Predefines
From: |
Nicolas Sceaux |
Subject: |
Re: nopc -- Proposed Predefines |
Date: |
Mon, 14 Jul 2008 15:27:06 +0200 |
Le 14 juil. 08 à 14:19, Bertalan Fodor (LilyPondTool) a écrit :
Well, the fun is that it seems that Scheme creators like predefined
commands as well. Think of the commands
cadr, caddr, cadddr, which are essentially:
(car (list-tail mylist 2)) (car (list-tail mylist 3)) (car (list-
tail mylist 4))
In SRFI-1, the first extension of the Scheme language even includes
the commands:
(first mylist) which equals (car mylist).
(second mylist) which equals (cadr mylist), ie. (car (list-tail
mylist 2))
...
(tenth mylist) which would equal (cadddddddddr mylist) if one had
had the idea to define such a command, ie. (car (list-tail mylist 10))
Am I insane that I find this complete nonsense?
Well, it does make sense. If you're dealing with a list (ie some
kind of sequence), FIRST and REST (and their friends, SECOND,
THIRD, etc) are to be used. If you're dealing with cons cells,
then CAR and CDR (and c[ad]*r) are to be used (think about it
like navigating in a binary tree). It's all about making clearer
what you intend to do. Behind the scene it is the same basic data
type, but the way you're using it is different, hence the different
names.
nicolas
- nopc, James E. Bailey, 2008/07/13
- Re: nopc, Mats Bengtsson, 2008/07/13
- Re: nopc -- Proposed Predefines, Carl Sorensen, 2008/07/13
- Re: nopc -- Proposed Predefines, Dominic Neumann, 2008/07/14
- Re: nopc -- Proposed Predefines, James E. Bailey, 2008/07/14
- Re: nopc -- Proposed Predefines, Bertalan Fodor (LilyPondTool), 2008/07/14
- Re: nopc -- Proposed Predefines, James E. Bailey, 2008/07/14
- Re: nopc -- Proposed Predefines, Bertalan Fodor (LilyPondTool), 2008/07/14
- Re: nopc -- Proposed Predefines, James E. Bailey, 2008/07/14
- Re: nopc -- Proposed Predefines, Bertalan Fodor (LilyPondTool), 2008/07/14
- Re: nopc -- Proposed Predefines,
Nicolas Sceaux <=
- Re: nopc -- Proposed Predefines, Paul Scott, 2008/07/14
- Re: nopc -- Proposed Predefines, Mark Knoop, 2008/07/14
- Re: nopc -- Proposed Predefines, Trevor Daniels, 2008/07/14
- Re: nopc -- Proposed Predefines, Carl Sorensen, 2008/07/14
- Re: nopc -- Proposed Predefines, Graham Percival, 2008/07/14
- Re: nopc -- Proposed Predefines, Reinhold Kainhofer, 2008/07/14
- Re: nopc -- Proposed Predefines, Bertalan Fodor, 2008/07/14
- Re: nopc -- Proposed Predefines, Graham Percival, 2008/07/14
- Re: nopc -- Proposed Predefines, Trevor Daniels, 2008/07/14
- Re: nopc -- Proposed Predefines, Trevor Daniels, 2008/07/14