Re: Pass by Reference

new topic     » goto parent     » topic index » view thread      » older message » newer message
Critic said...

But much Eu code is full of the usage of global variables, so the whole argument "but I want to see immediately if something is modified" is a moot point anyway.

I'm not sure you understood the original point. It wasn't about "something is modified." It was specifically about the arguments passed to the routine. Any language (Ok, maybe excepting pure functional) will allow changing some variable not within the scope of the routine.

Also, I'd quibble about your use of the term "global variables." While it's true that there is lots of code using global variables (of course, prior to 4.0, it was either local or global), I think you mean top level variables.

Even so, I don't think this criticism makes a lot of sense. Those top level variables are often the procedural equivalent to an object's member data in OO languages.

Also, your concerns don't mean a whole lot (in terms of expectations of effects of code). We're talking here about what a euphoria programmer expects. Since you've reminded us many times, those are words that will never describe you. I guess you're more of a Pascal programmer, where reference semantics and therefore expectation have existed for a while. A euphoria programmer does not expect for any arguments that are passed to a euphoria routine to be modified.

Even in languages like Java, there is a fair amount of confusion about how arguments are passed (hint: they are passed by value).

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu