Original date:2020-09-20 13:30:52 Edited by: petelomax Subject: Re: Promote Euphoria - MAKE A PAGE ON WIKIPEDIA

SDPringle said...

I am thankful that I don't need to make assignment statements for each call.

We instead only need to type:

include std/map.e as map 
map:map p = map:new() 
map:put(p, 2, "two") 
map:put(p, 3, "three") 
map:put(p, 5, "five") 

Actually, they should really have been implemented as assignments, probably, eg:

map p = new_map() 
p[2] = "two" 
p[3] = "three" 
p[5] = "five" 

I put similar handling in for Phix structs, which works by spotting/substituting "attempt to subscript an integer" cases, but forgot/failed to do the same for dict/map...

SDPringle said...

pass-by-value semantics

(to nit-pick) More correctly speaking, Euphoria/Phix has copy-on-write semantics - apart from integers it always passes a reference, but automatically clones when needed should it have a reference count > 1.

SDPringle said...

always well defined behavior.

Yep, mostly. However, binary_search() on an unordered haystack, and {s[idx],idx} = <expr> are two examples of undefined/unpredictable/unsupported outcomes.

SDPringle said...

declare before use.
ifdef is a regression in my view
allowing functions to be called as if they were procedures

Agreed. I half-get call-before-declare, but

s[1] = {1,2,3} 
string s 

and you have effectively just thrown away loads of opportunities for helpful compile-time messages, not to mention many potential optimisations.

For me though, the real killer is Euphoria/Phix don't work in a web browser or have anything like codepen/jsFiddle/ so I'm now toying with some ideas for that (but....)
Actually, there is (almost but not quite) - the only thing I could find anyway.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu