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

libgeneralist

Name: Anonymous 2011-09-12 22:56

So, /prog/, I'm writing a general library in C, with the aim of being somewhat inspired by libraries such as glib, but far lighter and cleaner. So far, I have a linked list implementation and a Unicode string implementation (this is incomplete), totalling 670 SLOC. The build system is cmake, the code is fully documented with doxygen. Of course, the library is in its infancy and far from finished; what other things should I implement? Any data structures? OS abstractions?

Name: Anonymous 2011-09-13 0:17

>>12
You don't need insertion for most things, you just need to add it to the end of the sequence, in which case dynamic arrays have ammortized constant time tail insertion.

>>13
My point is that lists lend themselves really well to functional programming/recursion/automatic memory management.

Sounds like Lisp hacker syndrome. Every call to car or cdr would not need to break apart an array, they need only provide a bounded view overtop of the underlying immutable array. How the fuck due you think lists work in Clojure? They sure as hell aren't linked lists underneath the hood. However, unlike CL, Clojure has strong referential transparency and immutability, so perhaps it wouldn't work quite as well for CL.

So in fact, I would argue that (immutable) arrays lend themselves far better to real functional than lists.

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