Re: Exceptions

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 18 Mar 2002, at 13:45, kbochert at ix.netcom.com wrote:

> 
> I have recently realized that it may be fairly easy to add
> exceptions (multilevel returns) to my 'extended' Euphoria.
> 
> procedure foo ()
>     if ...
>         throw ("Error in FOO ")
> end procedure
> 
> procedure foobar ()
>     foo ()
>     ...
> end procedure
> 
> procedure zot ()
>     ...
>     catch s
>     ?(s & " caught in ZOT")
>     exit()
> end procedure
> 
> throw would send a single sequence, which would
> travel up the stack to the first 'catch'
> 
> Any comments?

1a) Great!
1b) Wonderful!

2a) can the catch() in zot() peek at more than one throw()?
2b) will multiple throws be nested s?, in keeping with Euphorian sequences?
2c) will those nested throws be named as to who threw them? Like 
{{"foo","Error in FOO "}{"foobar","dbz error"}{"zot","it broke"}}

3a) can zot() catch what it is looking for and ignore the rest of the throw()s?
3b) will the ignored throw()s keep passing up to whoever called zot()?

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu