[elephant-devel] set-valued slots review
Alex Mizrahi
alex.mizrahi at gmail.com
Mon Sep 12 15:31:35 UTC 2011
> IV. Lacking features
>
> I think it would be great if we also add features for:
>
> 1. Initializing slot-set from list. Something like:
> (setf (numbers-of obj1) (make-slot-set :items '(1 2 3 4))
>
> 2. Wipe contents of a slot-set. You can do it via slot-makunbound, sure,
> but it is kinda ugly. (setf (numbers-of obj) NIL) is kinda weird because
> otherwise it doesn't recognize lists.
> (setf (numbers-of obj1) (make-slot-set) is, perhaps, appropriate, except
> it would create unnecessary object.
>
>
Or, alternatively, use lists:
(setf (numbers-of obj) '(1 2 3))
(setf (numbers-of obj) ())
It is kinda asymmetric because accessor will return a slot-set object
rather than a list, but at least it is more consistent than using setf
for inserting items.
More information about the elephant-devel
mailing list