1. New Wiki page Pass By Reference OOP Style

Pass By Reference OOP Style

It might be a little wordy. It's late and I tend to ramble on and on until you just wish the sentence will finally, once and for all, come to an end when it's late.

Topics covered

  • eumem
  • Implementing a struct in Euphoria
  • Implementing type checking for structs
  • Pointers.
  • Contructors, getters, and setters
  • Briefly touched on a variety of other related topics.
new topic     » topic index » view message » categorize

2. Re: New Wiki page Pass By Reference OOP Style

A fine article and a working example. We all want to see more!


You could work some of this into your article:

Pass-By-Value: Safe

Arguments in a subroutine are copies of values you pass in. Obviously, making a copy takes time and consumes memory. PBV is slow and inefficient but safe.

Pass-By-Reference: Fast

Arguments in a subroutine are just references to the value you pass in. Obviously, no lost time in making a copy and no extra memory consumed. PBR is fast and efficient but not safe.

oE is PBV Safe and PBR Fast

Pass an argument into a oE subroutine and it behaves like a copy. Changes to the value never alter the value outside the subroutine; oE programming is safe.

Pass an argument into an oE subroutine and it behaves like a reference. No copy is made; you can pass a huge (really huge) argment to a subroutine without a speed or memory penalty; oE programming is fast.

What is going on? oE makes copies of just what it needs inside a subroutine and maintains references back to the original as required. But, the original is never altered unless you explicitly assign a value to it.

Passing arguments in oE is fast, efficient, and safe.

_tom

new topic     » goto parent     » topic index » view message » categorize

3. Re: New Wiki page Pass By Reference OOP Style

_tom said...

A fine article and a working example. We all want to see more!

Thanks, I had help. Greg for example wrote a nice pastey that was the foundation for the code example. And so far, a couple of people have made edits to the wiki page.

More to come.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu