Python and Flaming Thunder

Dave Parker daveparker at flamingthunder.com
Wed May 28 09:22:53 EDT 2008


> Does this mean that Flaming Thunder requires explicit checking rather
> than offering exceptions?

Right now, yes, Flaming Thunder has minimal error handling.  But error
handling is rising on the list of priorities for the next few weeks
(arrays, matrices, and 3D graphics are the hightest).

I think in a month or two, Flaming Thunder will be using catch/throw
exception and error handling.  So, for example:

Set result to catch(read x from "input.txt".).
If result is an error then go to quit.

If not caught, errors will propagate up and if they they hit the top
level, cause the program to write an error message and exit.

Using only catch instead of try/catch has several advantages that I
can see.  1) it gets rid of all the impotent try/catch/throw
statements cluttering up Java, etc.  2) since all Flaming Thunder
statements return values (like C statements), Catch also gives you a
single, uniform, syntactically unambiguous way to embed statements (or
whole statement lists) into expressions -- without causing the
syntactic problems of = statements in if statements or the obfuscation
of question mark notation, etc.  For example:

If catch(set x to y+z.) < 0.1 then go to tinyanswer.

On May 22, 4:19 pm, Brian Quinlan <br... at sweetapp.com> wrote:
> Dave Parker wrote:
> >> Or just:
>
> >> If command is "quit" ...
>
> > Hmmm.  In Flaming Thunder, I'm using "is" (and "is an", "is a", etc)
> > for assigning and checking types.  For example, to read data from a
> > file and check for errors:
>
> >      Read data from "input.txt".
> >      If data is an error then go to ...
>
> Hey Dave,
>
> Does this mean that Flaming Thunder requires explicit checking rather
> than offering exceptions?
>
> Cheers,
> Brian




More information about the Python-list mailing list