[DGD] Fw: Re: callout cantrip

Noah Gibbs noah_gibbs at yahoo.com
Wed Mar 18 01:53:11 CET 2009


  That's a really good idea!  Definitely cleaner than the Phantasmal method of re-throwing.

  I don't know the scope of TLS vars relative to atomic functions -- can this be used to get a function trace out of an atomic error?  Phantasmal encodes it in the error string itself, but that can run afoul of string length issues.

--- On Tue, 3/17/09, bart at wotf.org <bart at wotf.org> wrote:

> From: bart at wotf.org <bart at wotf.org>
> Subject: Re: [DGD] Fw: Re: callout cantrip
> To: "All about Dworkin's Game Driver" <dgd at dworkin.nl>
> Date: Tuesday, March 17, 2009, 5:24 PM
> Well, that idea seems to work quite well..
> 
> a=2; 
> b=0; 
> catch { 
>   return a/b; 
> } : { 
>   write(caught_error(1)); 
> }
> 
> 
> when called causes:
> 
> [CAUGHT] Division by zero
> Object: /std/user#62, program: /std/user, line 187
>  187 receive_message   /std/user (#62)
>  182 _receive_message  /std/user (#62)
>  675 receive_message   /std/player (#79)
>   23 main              /cmds/wiz/eval
>   10 exec              /tmp/aidil
> 
> Code is in the latest gurbalib distribution and in
> subversion of course.
> 
> On Sat, 14 Mar 2009 16:02:48 +0100, bart wrote
> > Talking about such 'tricks', I've been
> pondering saving a copy of the
> > call_stack or an 'interpreted version' of it
> in a tls var when 
> > encountering a caught runtime error so one can rethrow
> it and 
> > provide a proper trace of the caught error.
> > 
> > Bart.
> 
> --
> Created with Open WebMail at http://www.bartsplace.net/
> Read my weblog at http://soapbox.bartsplace.net/
> 
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd


      



More information about the DGD mailing list