forum-msg-id-132451-edit

Original date:2018-04-16 05:19:15 Edited by: ChrisB Subject: Re: Very First Language to Learn: Phix or Euphoria?

Hi

Have ou looked at Phix's /builtins directory. Pretty much the entire std library is there, and there are many examples of dual purpose. One of the reasons I like Phix is that I don't have to specify which includes I want - they are included as needed, unless they are not part of the standard set. You can add in other includes and specify them, and just like eu you will have to specify namespaces too.

The older way to do Phix and eu specific code was with the block comment code

--/* Not required for Phix (defined in psym.e) 
-- ERROR STATUS 
global constant DB_OK = 0, 
                DB_OPEN_FAIL = -1,  
                DB_EXISTS_ALREADY = -2,                                               BLOCK IGNORED BY PHIX 
                DB_LOCK_FAIL = -3,                                                    BUT NOT BY EU 
                DB_BAD_NAME = -4, 
                DB_FATAL_FAIL = -404 
         
-- LOCK TYPES 
global constant DB_LOCK_NO = 0,         -- don't bother with file locking  
                DB_LOCK_SHARED = 1,     -- read the database 
                DB_LOCK_EXCLUSIVE = 2,  -- read and write the database 
                DB_LOCK_READ_ONLY = DB_LOCK_SHARED -- (Cover Eu4 stupidity) 
--*/ 

but you can now use IFDEF

ifdef PHIX then  
    puts(1,"this is Phix\n")  
elsedef  
    puts(1,"this is Eu\n")  
end ifdef  

You can also put includes in these Phix / eu specific blocks

Cheers Chris

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu