Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

My opinion on LISP

Name: Anonymous 2009-12-29 17:09

<My Opinion>The default list type of LISP should be doubly linked.</My Opinion>

Name: Anonymous 2009-12-29 17:18

Then your other cdr would be a cir.  Are you prepared to live with that?

Name: Anonymous 2009-12-29 17:21

When I saw the tags I expected the worst ;)
This isn't a completely terrible idea not an original one either, but the two part cons cell is pretty firmly embedded by now. How about you write a toy Lisp interpreter and see how it works out.

There does however remain one important question what is the third cons primitive car,cdr,c?r

Name: Anonymous 2009-12-29 17:23

>>1:1: parser error : Specification mandate value for attribute Opinion
<My Opinion>The default list type of LISP should be doubly linked.</My Opinion>
           ^
>>1:1: parser error : expected '>'
<My Opinion>The default list type of LISP should be doubly linked.</My Opinion>
                                                                       ^
>>1:1: parser error : Extra content at the end of the document
<My Opinion>The default list type of LISP should be doubly linked.</My Opinion>
                                                                       ^

Name: Anonymous 2009-12-29 17:32

It's easy enough to implement it. Personally, I'm quite fine with a single linked list, and using a doubly linked list would complicate things a lot. I can easily implement doubly linked lists and utility functions to work with them, and I use them when I need them, but why would you want to have that overhead imposed on the entire language?
(Actually there were such lisps in the past. You can guess why they never got popular.)

Name: Anonymous 2009-12-30 5:11

<My Opinion>The cdr of a cons cell should only allow lists.</My Opinion>
Then all cons cells would be lists, also optimization of lists would be easier (especially if they were immutable too).

Name: Anonymous 2009-12-30 13:02

>>6
Make your own statically typed "lisp" with type inferrence. It might be a fun project to work on.

However for real work, I'll take my mutable cons cells any day as they behave like real pointers and allow me to build ad-hoc data structures from linked lists, to association lists to pairs to sequences to trees to graphs. If I wanted cons cells which can only be used to make linked lists like you propose I'd be using a statically typed ML-like language, where the linked list can be defined like this:

type LinkedList = Cons of value * LinkedList | Nil;;

But since I'm using Lisp, it means I do make use of the dynamic typing.

Don't change these.
Name: Email:
Entire Thread Thread List