<div dir="ltr">Sorry for the late answer, I've been on a holiday last week.<div style><br></div><div style>In general your patch seems to be all right. In the definition part I would probably leave out the quote before the natural key's name. The issue you mentioned could be easily solved by splitting the slot in the persistent class into two. Also instead of generating different find functions you could have one that is called like (find-by-natural-key 'ssn :social-security-number ...)</div>
<div style><br></div><div style>I'm not entirely sure that this is a feature worth including as it is now. It solves a very specific database constraint strongly related to RDBMS, although I can see certain uses it. Also note that this feature should work with multiple inheritance and various slot storage settings. e.g. what happens if two slots of a natural key are stored in two tables? what about abstract base classes? are natural keys inherited?</div>
<div style><br></div><div style>Once in the good old days we had the idea of implementing a generic object oriented database constraint mechanisms (also used by the meta GUI) that would optionally be compiled down to SQL indices, triggers, before commit hooks as needed... but that was before we decided that we unfortunately can't make a living from programming in common lisp.</div>
<div style><br></div><div style>Regards,</div><div style>levy</div><div style><br></div></div>