Re: prohibited traps
Adam Megacz <adam <at> xwt.org>
2002-11-02 21:06:09 GMT
Jayson Vantuyl <kagato <at> chaosium.net> writes:
> On Tue, Oct 22, 2002 at 12:02:49PM -0700, Adam Megacz wrote:
> > Yep. The main reason is that we don't want people doing stuff like this:
> > __invisible = function(i) { return false; }
> I've always wondered why you just didn't honor read traps (but write
> traps were okay)?
The same reason that Object.wait() and Object.notify() are declared
"final" in Java. Those are well-known, public methods that every
object must export. Changing the behavior of those methods would make
the Object no longer "really an Object".
I think of properties as split into two categories: external
properties (properties that your parent boxen will manipulate, like
invisible, align, width, etc) and internal properties (properties that
only you should manipulate, like orient, color, image, and border).
I'd like the external properties to work the same way on every bos.
> Also, can anyone explain to me what it means when I return from a write
> trap? In other words, does this do something?
The return value is ignored -- it serves no useful purpose.
> How do I determine the order in which traps cascade?
In general you should really try not to depend on the trap invocation
order, but the _last_ trap to be added gets executed _first_. So
traps cascade in the reverse order in which they were added. Sorta
like Java methods that cascade with super.foo().
- a
--
--
"Through your rags I see your vanity" -- Socrates
_______________________________________________
http://lists.xwt.org/listinfo/dev