[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: class system with token filters
- From: "Gavin Kistner" <gavin.kistner@...>
- Date: Fri, 15 Sep 2006 08:27:18 -0600
> class BonusAccount, Account do
> function getBalance()
> print("BonusAccount.getBalance()", self.balance * 1.2)
> return base.getBalance() * 1.2
> Any o(pi)nions?!
I probably wouldn't use this myself becuase I have my own class system that I use. However, since you asked for opinions:
1) I don't like the 'do' keyword there. Function definitions don't have one, so why have one for classes?
2) If you're modifying syntax, I personally prefer Ruby's syntax for showing inheritance during class definition:
class Foo < Bar
What you have there looks like you're defining two common classes at once or something.
3) endclass? Feels like a very hacked-on approach. 'end' is the way to go, if you could make it happen.