Phix: Strange Behavior

new topic     » topic index » view thread      » older message

Hallo,

While working with maze3d.ex from this thread: https://openeuphoria.org/forum/139479.wc?last_id=139488

Something strange happened to me; I tried to incorporate it into a small program to illustrate the issue. Of course, this causes the program to crash under Phix.
The function is'nt actually necessary in principle.

Maybe it's just me, and I'm missing something.

--/* 
include std/console.e 
--*/ 
constant RAYWHITE={245,245,245,0} 
atom COLOR_IS_SEQ = sequence(RAYWHITE) 
?COLOR_IS_SEQ 
function mzRGB(integer r, integer g, integer b, integer a = 255)  
    if COLOR_IS_SEQ then  
        return {r, g, b, a}  
    else  
        return r + g * 256 + b * 65536 + a * 16777216  
    end if 
end function  
 
?RAYWHITE 
?sequence(RAYWHITE) 
?mzRGB(1,2,3) 
COLOR_IS_SEQ = 1 
?mzRGB(1,2,3) 
wait_key() 

Result with Phix:(unexpected)

1 
{245,245,245,0} 
1 
4278387201 
{1,2,3,255} 

Result with Euphoria:(expected)

1 
{245,245,245,0} 
1 
{1,2,3,255} 
{1,2,3,255} 

Andreas

new topic     » topic index » view thread      » older message

Search



Quick Links

User menu

Not signed in.

Misc Menu