jeanpierreda at gmail.com
Sun Jul 1 11:18:09 CEST 2012
On Sun, Jul 1, 2012 at 3:28 AM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>> C, SQL, REXX, and many other languages.
> So, languages without strong typing then. In that case, I revise my
> statement: I know of no programming language with strong typing that
> would give a newcomer to Python the above expectation.
OCaml is a language with absurdly strong typing, where a < b < c is
equivalent to (a < b) < c.
Obviously, this only works if c is a boolean, and if a and b are the
same type. Otherwise it is a type error.
Also, you claimed earlier that the notion of associative "<" is not
founded in mathematical notation. It really depends on whose
mathematical notation you use -- there's more than one, you know. For
example, it's reasonable to expect < to be left- or right-associative
in a system like Rick Hehner's Unified Algebra:
http://www.cs.toronto.edu/~hehner/UA.pdf (although, he himself doesn't
specify it as being one or the other, so by default one would assume
'a < b < c' to be nonsensical.)
More information about the Python-list