View Single Post
  #15  
Old 01-23-2008, 03:36 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
My solution was similar to some method in actionscript (I'd guess addmember). You provide the variable's name and the names of the get/set functions.

PHP Code:
function someclass() {
  
temp.var = TStaticVar();
  
with (temp.var) {
    
this.rvalue = function (obj) {
      return 
this.(@ obj);
    };
    
this.lvalue = function (obj) {
      return 
this.(@ obj).link();
    };
    
this.addmember("counter","rvalue","lvalue");
    
this.counter = -1;
  }

So depending on whether the member is the r- or lvalue, either function is called. It can be easily modified to allow for specific data types, variable protection, etc., and doesn't break backwards compatibility. The dummy/standard functions are given here.

Anyway, that's enough for derailing this thread, methinks.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote