View Single Post
  #9  
Old 03-13-2008, 01:14 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
OH GOD HELP I'M IN A BOX.

PHP Code:
// someclass_a
public function foo() {
  return 
3.141592653;

PHP Code:
//someclass_b
public function foo() {
  return 
589793238;

PHP Code:
function bar() {
  
temp.var = new TStaticVar();
  
with (temp.var) {
    
this.join("someclass_a");
    ...
  }
  return 
temp.var;
}

function 
baz() {
  
temp.var = new TStaticVar();
  
with (temp.var) {
    
this.join("someclass_b");
    for (
cbar().joinedclasses)
      
this.join(c);
    ...
  }
}

function 
onCreated() {
  
temp.bar();
  
temp.baz();
  echo(
temp.r.foo() @ temp.z.foo());

Also, since I'll bet you'll be wondering, yes, you can make abstract datatypes this way. And you can inherit directly (in baz: temp.var = bar()) if children do not try to overwrite functions.

As for longer numbers, you can use strings to display them, or I'm sure there are ways (not easy ways, mind you) for arbitrary precision math. I won't go into detail.
__________________
◕‿‿◕ · 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