MLUG: [MLUG] Re: Testing results
[MLUG] Re: Testing results
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Michael <mogmios> wrote:
> >This is particularly important in scripting languages with variadic run-time
> >typing, such as Perl, PHP, Python, Groovy, etc.
> >
> Python doesn't suffer from such problems because it doesn't let you set
> data inside of a conditional check.

Nonsense. Python absolutely performs automatic type conversion whether the
operator is a conditional or not. The style of coding the known datatype
on the left determines the datatype of the operation, that is if your
language uses a traditional LALR parser (in simple terms, left-to-right).

Last I checked, Python was one of those. The problem has nothing to do
with setting data (i.e. an LVALUE expression) inside a conditional check.
It has to do with how you code a binary operator, LVALUE or not, in order
to control explicitly the automatic type conversions (i.e. casts) that are
going to occur in your expression.

Thus, preventing inadvertant promotion to float math or double math when
simpler datatypes are what is required.

Alternatively, highly expressive languages like Perl can impose explicit 
runtime restrictions on type promotions (e.g. the "use float" or "use 
integer" directives).

And even if I were to grant you that Python doesn't suffer from "such
problems" -- that, my friend, is the /least/ of the problems from which
Python *does* suffer, besides being in a perpetual state of Perl-envy.

Mike/
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members