Capabilities are normally going to be stored in records on various attributes. The format is going to be: capabilities( foo:<ozname> bar:<ozname>), where foo and bar are methods on the object. Theses lists will be seperate from the attribute holding the reference to the object wrapper procedure. So, for example, the list of exits from the current location would be retrieved as follows:
{@location.wrapper @locationCapabilities.listExits listExits($)}
Note that this means there are two attrs for every capability list. When that request for listExits comes in, the object wrapper selects the appropriate method from its dictionary which is keyed on the Oz names of the methods, and calls that method.
This way of doing things unfortunately breaks the abstraction of treating the object wrapper as though it were just another object. It was possible to make it much cleaner, but it made saving objects a gigantic pain and added a bunch of code. There were other ways of handling it without those drawbacks, but they all put a fair bit of knowledge burden on the coder in terms of understanding how Oz constructs records and such.
If you really want to make a function that returns a function that acts just like a normal object (which I don't particularily recommend, by the way: it'll probably slow things down a bit), here's what one would look like:
proc {CapProcMaker ObjProc CapList ?CapProc} proc {CapProc Meth} {ObjProc CapList.{Label Meth} Meth} end end
Note that it is very important that you not try to save this procedure
on your object (i.e. do not add it to the exports variable of the
class), as this will cause the saving to fail. This means that if you
are storing this procedure on an attr you need to check for its
existence (probably using IsDet or Value.type) pretty much every time
you use it, or make sure it gets recreated every time your object is
reloaded (i.e., create it in your start
method).