Re: Python has Traps; Does Euphoria have Programming Traps?
- Posted by _tom (admin) Aug 14, 2013
- 2190 views
My thanks to you for developing Euphoria!
This is the first "trap" I have found in Euphoria.
The following lines execute without any warning or error messages:
? 0 <= 5 <= 9 --1 ? 0 <= -5 <= 9 --1
Python (and a few other languages) allow this:
Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 0 <= 5 <= 9 True >>> 0 <= -5 <= 9 False >>>
The Euphoria way of writing:
? 0 <= 5 and 5 <=9 -- 1 ? 0 <= -5 and 5 <= 9 -- 0
How do I explain what is happening?