[rucksack-devel] Re: rucksack-devel Digest, Vol 2, Issue 1
Arthur Lemmens
alemmens at xs4all.nl
Thu Jun 15 18:29:52 UTC 2006
Ken Tilton wrote:
>> (defmethod make-account (uname pass)
>> (add-rucksack-root (make-instance 'account ...) xxxx))
>>
>> But I can't, because these methods needs to know the rucksack instance
>> that they operate on (above shown with xxxx).
>>
>> What do you think about this? Is this kind of abstraction possible?
>
>
> Make that *xxxx* (or *sack* or *db* or *db-root*) and you are good to go.
> ie, This is a classic use for special variables, in this case bound by your
> with-accounting macro.
>
> If I understood you. :)
That's how I understood it as well.
You could also consider something like
(defun make-account (user-name password &key (db *account-db*))
(add-rucksack-root (make-instance 'account ...) db))
Arthur
More information about the rucksack-devel
mailing list