Wow! I wasn't expecting to hear back from you until Monday :) I haven't been able to run your code yet. I downloaded SBCL for PPC but have not been able to successfully compile Elephant with it. I will continue trying. I used to have it working before, but stopped using SBCL a while ago for OpenMCL. Anyway, some comments before I can run your code and provide more feedback: 100% agree with all this. However, one thing that might have been oversimplified is when it comes down to complex relational queries. There are two main issues to address here: 1) The nature of dynamic queries as presented in my original email: your explanation and code seems to address this in a subtle way and, although I believe you when you say it works, I'd say that it could be enhanced in a way to make it generic enough. I remember the how Peter Siebel presents such a nice and simple interface to querying a CD/MP3 database in Chapter 3 of his Practical Common Lisp book. In a way, he kind of developed a small domain language for querying and I think something like that can be implemented with the sample code you provided below. 2) What happens when you have multiple relational tables... or more appropriate in our case, when you want to query an object model based on different object and object relational hierarchies. Say, for example, you have class person which has references to an object called demographics and an object postal-code, which, in turns, has a reference to an object state. How would you apply your proposal to a query such as "give me all 'males' under the age of 30 who live in 'NY' sorted by age in descending order and then by last, first names". It obviously is very simple to do this in SQL (if the proper relations exist between the tables), but may not be (or at least doesn't seem to be initially) as trivial in Elephant or applying your code below. Your dynamically constructed list of query-able columns approach may be a bit limited. Also, class indices may not necessarily be appropriate either in these situation. Maybe I haven't delved deeply enough into your proposal and/or haven't given it sufficient thought (I apologize for that if I belittled your proposal). I definitely understand the potential overhead of using secondary indices and agree that their use should be determined by how often you really need to search by those slots. I will continue trying to make SBCL work again in my PPC and then run your code. Maybe play with it and try to simulate different scenarios such as I mentioned above. Will then send more comments. Thanks again, Daniel P.S. I don't mean to distract anyone from the main thread of this email. But I noticed how you make use of format to append values to strings (e.g. random-password). Is that like the only way to do so, or maybe the more efficient way of doing so? Thanks again On Nov 12, 2006, at 6:45 PM, Robert L. Read wrote: Dear Daniel and Team, The code below generated 100 random "users". The bare act of defining this class defines accessor-functions that we can use in dynamically constructed lists as below: (list 'username-of 'balance-of). I have written very small functions that use such lists either to define define "lexicographic" sort orders based on the order of the functions within the list. That is, the primary sort criteria is the first function in the list, but of that function is equal for two values, the next is used and so on. If you load the below code and execute (show-off) several times I think you will see what I mean. You can then see how easily you can change the list of functions that are either in the selector or the sort criteria. If this is a web-based app, these list will be generated from the http-query, which is generated by the user's clicks. |
_______________________________________________ elephant-devel site list elephant-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/elephant-devel