Python and Flaming Thunder

Dave Parker daveparker at flamingthunder.com
Wed May 21 11:15:30 EDT 2008


> 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 ...

Or when assigning a type to an identifier:

     HarmonicMean is a function(x, y) ...
     LoopCount is a variable ...

By using = only for equality and "is" only for types, the Flaming
Thunder compiler can detect when either is being used incorrectly
because the syntax for the two is incompatible.  That avoids the man-
years of wasted debugging time spent on languages that accept
statements that are easily confused, yet syntactically valid (e.g. the
confusion between = and == in C if-statments, or the confusion between
= (equality) and "is" (identity) in Python).

On May 20, 3:41 pm, MRAB <goo... at mrabarnett.plus.com> wrote:
> On May 20, 4:33 am, Dave Parker <davepar... at flamingthunder.com> wrote:
>
>
>
> > On May 14, 7:59 pm, John Salerno <johnj... at NOSPAMgmail.com> wrote:
>
> > > Would it be valid to say:
>
> > > x = "concrete"
>
> > > or to say:
>
> > > if command (is) set to "quit"
>
> > > ??????
>
> > I like the idea of:
>
> > If command is set to "quit" ...
>
> Or just:
>
> If command is "quit" ...
>
>
>
> > I've added it to my list of things to think about, and possibly
> > implement.- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -




More information about the Python-list mailing list