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

Pages: 1-

Cons cell

Name: Anonymous 2010-09-12 12:05

Is it the ultimate data container? There's not much it can't do. What could possibly beat it?

Name: Anonymous 2010-09-12 12:08

Random Access Lists

Name: Anonymous 2010-09-12 12:13

I'm waiting in my cons cell, when the bell begins to chime.
Reflecting on my past life and it doesn't have much time.
'Cause at 5 o'clock they take me to the collector
The sands of time for me are running low.

Name: Anonymous 2010-09-12 12:58

The bit vector can contain any data, as long as you can describe an appropriate encoding.

Cons cells are specialized structures of 2 slots, they're very useful in building linked lists, graphs, circular structures and many other things. They are both general and specific, however they're only suitable for some kinds of data.

There is no such thing as ``ultimate data container'', there's only more suitable and less suitable to some goal. There is no ``best'' container, or in general ``best'' solutions. What is ``best'' depends on your exact problem and requirements, and even then, there might not exist a ``best'' representation - you'll always make trade-offs.

Name: Anonymous 2010-09-12 14:25

C here, struct is king.

Name: Anonymous 2010-09-12 16:17

>>2
Generational stop-and-copy garbage collection could achieve something like a random access list. If, after copying, elements are contiguous, then one could use pointer offsets to access the nth element. You couldn't instantiate a random access list but in the background a list could turn into a vector if it was never mutated. If it was around for a while an old list would turn into a vector.

Name: Anonymous 2010-09-12 16:32

Data structures are an illusion. There is only the memory block.

Name: Anonymous 2010-09-12 18:13

>>6
I was actually thinking of SRFI 101 (draft) which is based on work by Okasaki.

Name: Anonymous 2011-01-23 9:25


(define (hurr hurr)
    (if hurr))

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