Re: Promote Euphoria - MAKE A PAGE ON WIKIPEDIA

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

What I meant earlier by Euphoria having "pass by value semantics", is that the way EUPHORIA passes parameters into routines is indistinguishable to pass by value barring time profiling or looking at the source code. I think I should have used the word "behavior" or "specification". There may be two implementations of some stack library and they may be implemented in different ways but it would still have this first in last out "behavior". Take what I said earlier to mean "observable behavior".

petelomax said...
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 

...

Maybe there are some special circumstances for this kind of thing with variables being declared after. It turns out this code gives an error:

include std/types.e 
s[1] = {1,2,3}  
cstring s  

The error is

<0074>:: Errors resolving the following references: 
    's' (wtf.ex:2) has not been declared. 
 
s[1] = {1,2,3} 
 ^ 

We probably do have different checkout revisions of Euphoria. It would surprise me if that wasn't the case.

As for the map example, there are all kinds of situations where the user needs to type in the same value twice because the true intention is to modify a value rather than assign a new value. I have some ideas for that. They all have the following properties.

  • The modified object has to appear once in the expression.
  • It must look different to a normal pass by value call.

The last thing I would like to see in EUPHORIA would be something like this:

-- Append is now pass by reference 
append(s, 5) 

These are some of my ideas

countries = append(countries, "Sweden") 
-- becomes 
countries.append("Sweden").   
-- or 
countries append="Sweden" 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu