Re: Promote Euphoria - MAKE A PAGE ON WIKIPEDIA
- Posted by petelomax Sep 20, 2020
- 1409 views
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...
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.
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.
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, and any and all notions of variable scope going completely whack-a-doodle.
For me though, the real killer is Euphoria/Phix don't work in a web browser or have anything like codepen/jsFiddle/repl.it/tio so I'm now toying with some ideas for that (but....)
Actually, there is (almost but not quite) http://golf.shinh.org/l.rb?exu - the only thing I could find anyway.