Re: A Collections Framework?
- From: "Captain Obvious" <udodenko@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 15 May 2010 15:57:25 +0300
s> In what way do CL generic functions and CLOS fail to be many times
s> more powerful and better at expressing interfaces than Java
Is this "Have you stopped beating your wife?" sort of a question? :)
I do not think that there is any problem with CLOS.
A problem with "collections framework" for CL is just that nobody wrote one.
You see, there are lots of wealthy companies which use Java, and they can afford to hire lots of programmers to write that framework for Java.
There are less companies working with CL, and, apparently, they address their needs with existing solutions, so there is no great need to a great unified library. It would be nice to have one, but isn't strictly required, as one can use lists, or hash tables, or FSet library, or one of btree libraries, or uses pieces of cl-contaniers which actually work, or write their own implementation.
So lack of an unified library is not a showstopper. One can benefit from it providing unified interfaces so he can switch between different underlying implementations and see if there is a speedup. But he can as well write his own adapter functions for this, that might be just few lines of code...
I guess a problem with it is that framework which really covers everything is a tremendous work. You can easily write adapter functions which will work both for balanced trees and for hash-tables (for example), but taking all possible trait combinations into account is hard.
To start with, there is a problem with classification even before you come to an implementation.
There are associative containers, iteratable containers, searchable ones, ones where you can insert in the middle, into one or both of its ends, or it just doesn't matter where you insert, there are ones which support indexing and ones which do not...
Some of these traits are orthogonal and some are not. For example, if collection provides index access, then for sure it is ordered and iteratable.
Then there are multiple ways to look at one particular collection -- e.g. if you have a balanced tree with pairs, you can either consider it as an associative container or not.
Maybe you want to provide both interfaces?
I don't know if it is possible to copy Java or C++ collection library. Those are different languages and choices library writers have made might be not really optimal for CL.
So a problem is on conceptual level, not technical level.
If you're a Lisp neophyte, you might be over-excited with language features. Don't forget that great language features do not write code for you, they just let you to express your thoughts in more clean way.
- Prev by Date: Re: make-instance without initialize-instance
- Next by Date: Call for papers: AIPR-10, USA, July 2010
- Previous by thread: Re: A Collections Framework?
- Next by thread: Re: A Collections Framework?