[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Cryptic OOP syntax
- From: "Steve Donovan" <sjdonova@...>
- Date: Thu, 27 Jan 2005 10:08:39 +0200
>>> firstname.lastname@example.org 01/27/05 05:05AM >>>
>I'm impressed with the ideas that came up on the subject OOP in Lua.
But most (if >not all) of them lack a clear syntax in on place or
another. I need a simple, clear >syntax so users of my apps can extend
it without much trouble.
What would be cryptic about this style? It's very
straightforward to implement:
Animal = class()
self.name = name
Dog = class(Animal)
>Am I asking for syntatic sugar? Yes, sure!
It's easy to make simple lexical
substitutions, like '@' for 'self.'
If there was some way to flag a function as
being a method, then that explicit ':' could
just be a '.' There's an interesting