Fortress Programming Language Tutorial.pdf - Free
Fortress Programming Language Tutorial.pdf - Free
Fortress Programming Language Tutorial.pdf - Free
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Fortress</strong> <strong>Programming</strong> <strong>Language</strong> <strong>Tutorial</strong>, PLDI, 11 June 2006Parametric Objectsobject Cart(re: R, im: R) extends Copr (self, other: Cart): Cart =Cart(self.re + other.re, self.im + other.im)opr (self): Cart =Cart(-self.re, -self.im)opr (self, other: Cart): Cart =Cart(self.re - other.re, self.im – other.im)opr ·(self, other: Cart): Cart =Cart(self.re · other.re – self.im · other.im,self.re · other.im + self.im · other.re)opr |self| : R = √((self.re) 2 + (self.im) 2 )...end© 2006 Sun Microsystems, Inc. All rights reserved.27