Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Functional > Re: the necessi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 33 Topic 2757 of 2841
Post > Topic >>

Re: the necessity of Lisp's Objects?

by rem642b@[EMAIL PROTECTED] (Robert Maas, see http://tinyurl.com/uh3t) Feb 4, 2008 at 10:37 AM

> From: Xah Lee <x...@[EMAIL PROTECTED]
>
> The cons business. (lists are made up of cons cells and it is
> necessary for the programer to understand this to write any non-
> trivial lisp program)

IMO the way to write a program is to design an abstract data type
then to use it. Only the person hand-coding the implementation of
that ADT need worry about low-level details such as cons cells.
Most of the time the programmer can use mapping functions (for
lists, or for association lists, or for property lists, or for hash
tables, or for various binary trees such as AVL trees) and not
really care that these various structures are really built of cons
cells. But the fact that structures (except hash tables and arrays)
are directly built out of cons cells allows different objects to
share common structure. For example, large binary trees can share
all but the changes, thereby allowing update of a tree
non-destructively to take log(n) time, keeping both old and new
around simultaneously taking only log(n) extra space beyond a
single copy.

> No highlevel treatment of lists. (In Mathematica, there are a
> system of functions to extract or manipulate (nested) lists
> considered as trees. e.g. getting all elements at a level, or
> arbitrary set of nodes of a tree. All these based on a tree index
> concept. (i.e. first branch's second branch's third's branch will
> be 1,2,3.) In lisp, programers uses cons, car, cdr, caadr, etc.

Why 1,2,3 instead of 0,1,2? That point is too petty to fuss over.
Otherwise, you're just plain wrong. Look up the fuction NTH,
which indexes down a list by a given number.
Then imagine how trivial it is to write a function that uses a list
of successive indexes to specify the element number at successive
levels within a list, calling NTH at each level.
You can even offset by one if you really really need that.




 33 Posts in Topic:
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-04 10:37:38 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-06 17:14:18 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-06 19:42:31 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-07 00:07:54 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:14:09 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-10 10:27:07 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-15 23:12:34 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-16 21:02:03 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:21:54 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-10 01:48:39 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-11 23:29:33 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 16:37:06 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-07 22:25:25 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-08 21:06:41 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-09 15:24:21 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-10 10:26:42 
Re: the necessity of Lisp's Objects?
"David Formosa (aka   2008-02-10 11:23:32 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-10 23:54:27 
Re: the necessity of Lisp's Objects?
rpw3@[EMAIL PROTECTED] (  2008-02-11 02:56:22 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-11 20:53:12 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 02:17:33 
Re: the necessity of Lisp's Objects?
"John Thingstad"  2008-02-12 04:48:24 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 16:35:17 
Re: the necessity of Lisp's Objects?
George Neuner <gneuner  2008-02-12 15:18:23 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-12 20:16:55 
Re: the necessity of Lisp's Objects?
rpw3@[EMAIL PROTECTED] (  2008-02-12 05:34:01 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-11 10:41:47 
Re: the necessity of Lisp's Objects?
Barb Knox <see@[EMAIL   2008-02-11 09:52:26 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-15 23:17:07 
Re: the necessity of Lisp's Objects?
Jon Harrop <usenet@[EM  2008-02-16 20:46:11 
Re: the necessity of Lisp's Objects?
Pascal Bourguignon <pj  2008-02-08 22:33:21 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-20 15:25:52 
Re: the necessity of Lisp's Objects?
rem642b@[EMAIL PROTECTED]  2008-02-20 17:12:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:56:55 CDT 2008.