On 24 Nov, 2004, at 16:58, Pascal J.Bourguignon wrote:
> Joseph Kiniry writes: >> I'm porting an application (OBJ3) to CMUCL, SBCL, and CLISP. >> >> I need a function that will define a total order on two arbitrary >> structures. >> >> In my other ports, I've used internal functions to get lists of slots, >> orders on them, etc. >> >> Do the CMUCL, SBCL, and CLISP developers have suggestions for >> implementing such a function? I've dug around the internal >> functionality, but have not found an obvious solution to this problem. > > Should this order be the same on all these implementations? That is not necessary. > Should it be the same accross sessions? That is not necessary either, but the order should be consistent across a single session, which does constrain the algorithm to a degree on some CL implementations. > In general for structures it's not possible, there's no reflectivity > of structures. Either you limit yourself to the structure defined > with one of your macros that will keep the fields arround, or you'll > have to use CLOS. Unfortunately, OBJ3 is user-extensible, and the number of structures in use is quite large, so going the CLOS way is probably a better option. My concern was not knowing anything about the quality and completeness of CLOS/MOP implementations across CL platforms. Of course, learning about that now is wise given the next app I have to work on some more is PVS, which is written using CLOS... > Note that some structure types may be defined to be implemented with > lists or vectors! Yup, I've noticed. :) Thanks for your input! Joe
