Re: Python has Traps; Does Euphoria have Programming Traps?

new topic     » goto parent     » topic index » view thread      » older message » newer message

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?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu