Lisp "Signatures"
Hi,I have been working on a representation of B-Trees in Lisp, and what I have now separates the issues of how the trees behave internally from where their elements are stored. Hence, one module for B-Trees handles both in-memory trees as well as persistent disk-based trees. The insert / delete / find / map functions are identical code.
In arriving at this situation, I found that there were a very few required protocols to be followed by objects claiming to be B-Trees and B-Tree-Nodes, for proper participation in the handling code. The situation looks amazingly similar to ML Signatures, but without the nice degree of organization found in ML.
For example, one requirement is to have a B-Tree archetype that responds both to BTREE-ROOT-NODE [a reader] and (SETF BTREE-ROOT-NODE) [a writer]. How that object responds to these required generic functions is up to the B-Tree object itself. For the in-memory B-Trees this might be a slot in the class instance with a single accessor defined that produces both reader and writer. For the persistent version it might be entirely synthesized functions that correspond to each.
But the point here is that in satisfying the protocol each concrete implementation has a smattering of class slots with readers, writers, accessors, and perhaps a jumble of methods, all of which collectively satisfy the needs of the B-Tree management protocol.
So, what I'm wondering about is if anyone knows of any references to developments in Lisp for something akin to ML Signatures that could help organize this jumbled adherence into something more maintainable and centralized?
Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ 85750
email: dbm@refined-audiometrics.com
phone: 1.520.390.3995