And to achieve the same thing "after the fact", I suppose (set!> Obj '(+Admin +User)) would work?
On Sun, Nov 10, 2013 at 2:46 PM, Alexander Burger <[email protected]>wrote: > On Sun, Nov 10, 2013 at 01:30:28PM +0700, Henrik Sarvell wrote: > > But pretend I'd like to go down the prefix route instead. How would I do > > that practically so that I'd be able to use (extra)? I get the object > with > > (setq *Admin (db 'id '+User 3)) and how do I get +Admin to be a prefix > > class to the right of +User in the *Admin instance? As far as I can see > > this won't work: (db 'id '(+User +Admin) 3) will it? > > Yes, because 'db' needs a class, not a type (list of classes). > > > You could do: > > (class +User +Entity) > (rel id (+Key +Number)) > (rel nm (+Key +String)) > > (dm hi> () (prinl (: nm))) > > > (class +Admin) > > (dm hi> () > (prinl "Hi admin.") > (extra) ) > > > (pool "x.db") > > (new! '(+Admin +User) 'id 3 'nm "Edward") > > (hi> (db 'id '+User 3)) > > This prints > > Hi admin. > Edward > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe >
