On Mon, Feb 18, 2008 at 08:14:53PM -0800, David Brown wrote: > Well, no. As mentioned earlier Scheme and Python lists are very different > beasts.
Yes I was listening. IIRC all the points had to do with efficiency concerns. My comment about similarities/simplicity was purely about the *visual* simplicity and similiarity. Not a very profound comment I know. > I would argue the exact opposite. The cons cell is a "beautifully simple" > thing. The array/vector is the more complicated beast that gives better > random access performance but isn't as general. Naively, a cons is a box that holds 2 values. Naively, my lists are boxes that holds an unlimited number of values. In that regard, conses are restricted special cases of lists as I've just defined it. > Doing this with lists would take > more space. Ug, more complexity concerns. The practical real world rears its ugly head. > Another example is that Python lists can't represent circular data > structures, which Scheme/lisp lists can. In other words, you can't > implement set-cdr! without using cons cells. Hmmm, circular data structures. I assume you mean the last element points to the beginning? So you are saying conses can do pointer/pointing but lists can't? I'll need to think about that one. Chris -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
