Lisp HUG Maillist Archive

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
web: http://www.refined-audiometrics.com



Re: Lisp "Signatures"


El Dec 7, 2008, a las 10:48 PM, David McClain escribió:
> 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?

slime uses some macrology to manage interface definitions and  
implementations on various targets.
Have a look at its sources.

-- 
__Pascal Bourguignon__
http://www.informatimago.com




Re: Lisp "Signatures"

David McClain <dbm@refined-audiometrics.com> writes:

> 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?

Have a look at Rahul Jain's protocols at

  http://common-lisp.net/cgi-bin/viewcvs.cgi/protocols/?root=rjain-utils

I'd like to see this being made standalone.

  -T.


Re: Lisp "Signatures"

Hi there,

Naive question; I've not been able to glean enough from recent posts to
answer this.  Are "Signatures" (or Lisp "Protocols") some sort of
abstraction over Lisp Packages/Modules?

Thanks,
Brian C.


Updated at: 2020-12-10 08:41 UTC