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.

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to