Re: vote on prop keyword
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Lenard Lindstrom wrote:
> I have no problems with the prop keyword. But if it is a shorthand
> then is it necessary for "def"s before get_, set_, and del_?
>
> object Widget:
> price = 3.72
> prop tax:
> get_(): # There is no "def" here
> return self.price * 0.03
I could make get_, set_, and del_ keywords and make def optional, but that
would be a weird precedent and don't you think that is getting a bit too
cryptic just to save typing three keystrokes? If we did that then what
would keep us from doing the same thing with init_?
Object Widget:
init_(x): # There is no "def" here
self.x = x
Were you making a silly point just to show that we shouldn't have the "prop"
keyword? :-)