Re: Pass by Reference

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

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.

Fair enough.

Matt said...

Also, I'd quibble about your use of the term "global variables."

Everybody except some Euphorians calls it global variables. Of course it refers to lifetime, not necessarily scope.

Matt said...

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.

Maybe, but in contrast to objects in OO languages, the content of global variables doesn't get garbage collected and Euphoria code is often not re-entrant due to globals. So it's clearly technically inferior.

Matt said...

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

I know. I've said multiple times, PBR is not necessary if objects have reference semantics.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu