check if handler exist before using it

Richard Gaskin ambassador at fourthworld.com
Sat Nov 10 14:22:31 EST 2007


Mark Wieder wrote:
> Friday, November 9, 2007, 5:28:01 PM, you wrote: 
>> I may be a bit slow today as I'm caffeine free this afternoon, but 
>> wouldn't checking for the presence of the stack do the same as checking
>> for its handlers?
> 
> Pretty much, but not exactly... if I want to call the initialize()
> handler on a substack just knowing the stack exists doesn't tell me
> that it has an initialize() handler to call. And if it's a protected
> stack then I can't even query the script to see if it's there.

Is this for stacks written by others or ones you write yourself?

The reason I'm asking is that Ken and I have periodically brainstormed 
about a Holy Grail of a world in which components written by others 
might be shared in a way which allows other systems to use them without 
any a priori knowledge of what they do.  We started down the road of 
exploring this with parts of the RIP guidelines (at 
<http://tech.groups.yahoo.com/group/revInterop/), but had trouble coming 
up with real-world scenarios in which we would need to use other 
libraries without knowing what's in them.

So I'm hungry for examples of practical uses for such things, and maybe 
we could pull together some useful mechanisms for inclusion in a future 
edition of the RIP stuff.

-- 
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list