Python and Flaming Thunder
MRAB
google at mrabarnett.plus.com
Wed May 21 15:14:00 EDT 2008
On May 21, 4:15 pm, Dave Parker <davepar... at flamingthunder.com> 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 ...
>
> 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).
>
[snip]
I wonder whether "is" could be used both for "x is value" and "x is a
type" without causing a problem:
If command is a string ...
If command is "quit" ...
More information about the Python-list
mailing list