[elephant-devel] changing association slots

Marc klists at saphor.de
Wed Aug 13 06:06:12 UTC 2008


Hi!
> i forgot to attach the patch to the mail - so other users - if they have
> the same problem - will be able to compare the current source with our
> patch.
>
>   
here a slighly expanded version of the same patch that also allows 
remove-association to work for unbound slots.

Best regards,

Marc
>
>
>   
>> hi,
>>
>> while we were working on the problem "associations between instances of
>> the same class" we also were trying to solve the remove-association
>> problem.
>>
>> we have a suggestion - it differs a little from the original way, but
>> maybe it is helpful.
>>
>> so i sent a patch today.
>>
>>
>> regards
>>
>> lukas
>>
>>
>>     
>>> I was getting too much spam so require authentication on the Trac
>>> now.  The admins can be slow to grant accounts or enable Trac.  If you
>>> send me a report directly on e-mail I'll add it for you.
>>>
>>> Ian
>>>
>>> On Jul 9, 2008, at 3:55 PM, LukasGiessmann wrote:
>>>
>>>       
>>>> Hi Ian,
>>>>
>>>> I know this is not the right space to place this question butI don´t
>>>> know
>>>> were else I should do it.
>>>> Tried to get an account for http://trac.common-lisp.net/elephant; I
>>>> wrote
>>>> a mail to admin at common-lisp.net but haven´t got an answer yet.
>>>> Is there another possibility to mark this bug?
>>>>
>>>> Best regards
>>>> Lukas
>>>>
>>>>         
>>>>> I haven't looked at that code in a bit, but I suspect that the right
>>>>> thing happens if you just remove the association definition from
>>>>> defclass and reevaluate the defclass form.  Can you mark this as a
>>>>> bug
>>>>> in elephant so I can remember to look into it later?
>>>>>
>>>>> Thank you,
>>>>> Ian
>>>>>
>>>>> On Jul 4, 2008, at 4:24 AM, LukasGiessmann wrote:
>>>>>
>>>>>           
>>>>>> hello,
>>>>>>
>>>>>> since our last mail working with associations turned out to go quite
>>>>>> well
>>>>>> but one more problem came up:
>>>>>> i tried to change the associations by removing it and replacing it
>>>>>> by a
>>>>>> new association. but the function "remove-association" only works
>>>>>> partially.
>>>>>>
>>>>>> 1. in this one-to-one association the function doesn't work at all.
>>>>>> ---
>>>>>> (defpclass job()
>>>>>> ((title :initarg :title :accessor title-of :index t)
>>>>>>  (company :initarg :company :accessor company-of :index t)
>>>>>>  (job-holder :initarg :job-holder :accessor job-holder-of :associate
>>>>>> person)))
>>>>>>
>>>>>> (defpclass person()
>>>>>> ((name :initarg :name :accessor name-of :index t)
>>>>>>  (job :initarg :job :accessor job-of :associate job)))
>>>>>> ---
>>>>>>
>>>>>> an error message shows up:
>>>>>>
>>>>>> (remove-association *job1* 'job-holder *person1*) ; -> There is no
>>>>>> applicable method for the generic function  #<STANDARD-GENERIC-
>>>>>> FUNCTION
>>>>>> ELEPHANT::OID (1)> when called with arguments (NIL).
>>>>>>
>>>>>> same thing happens when i use the following statement:
>>>>>> (setf (job-holder-of *job1*) nil)
>>>>>>
>>>>>>
>>>>>> 2. by one-to-many associations generally nothing happens at all.
>>>>>> ---
>>>>>> (defpclass job()
>>>>>> ((title :initarg :title :accessor title-of :index t)
>>>>>>  (company :initarg :company :accessor company-of :index t)
>>>>>>  (job-holders :accessor job-holders-of :associate (person job))))
>>>>>>
>>>>>> (defpclass person()
>>>>>> ((name :initarg :name :accessor name-of :index t)
>>>>>>  (job :initarg :job :accessor job-of :associate job)))
>>>>>> ---
>>>>>>
>>>>>> it only works in this case:
>>>>>> ---
>>>>>> (drop-instance *person2*)
>>>>>> (remove-association *job2* 'job-holders *person2*)
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> 3. in the case of many-to-many associations everything goes fine.
>>>>>>
>>>>>> how do i get the "remove-association" function to work?
>>>>>> are there other ways for changing associations?
>>>>>>
>>>>>>
>>>>>> thank you for your help
>>>>>>
>>>>>> lukas
>>>>>>
>>>>>> _______________________________________________
>>>>>> elephant-devel site list
>>>>>> elephant-devel at common-lisp.net
>>>>>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>>>>>             
>>>>> _______________________________________________
>>>>> elephant-devel site list
>>>>> elephant-devel at common-lisp.net
>>>>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>>>>
>>>>>           
>>>> _______________________________________________
>>>> elephant-devel site list
>>>> elephant-devel at common-lisp.net
>>>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>>>         
>>> _______________________________________________
>>> elephant-devel site list
>>> elephant-devel at common-lisp.net
>>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>>
>>>       
>> _______________________________________________
>> elephant-devel site list
>> elephant-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/elephant-devel
>>
>>     
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> elephant-devel site list
>> elephant-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/elephant-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-association.patch.gz
Type: application/x-compressed-tar
Size: 6127 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20080813/6a9b6ab3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080813055629-e1a60-e712c0fd8ac5c33c82ec00cfdcb29314d774d158.gz
Type: application/x-compressed-tar
Size: 471 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20080813/6a9b6ab3/attachment-0001.bin>


More information about the elephant-devel mailing list