On Wed, 2002-11-13 at 02:31, Alan Knowles wrote:
Thanks to a little chat (and a few beers) with Zak at the conference, I
got wondering if this syntax would be a sensible addition...
[...]
syntax:
var [getter method] [setter method] $variable .;
+1
Plus, another syntax suggestion
On 13 Nov 2002, Timm Friebe wrote:
On Wed, 2002-11-13 at 02:31, Alan Knowles wrote:
Thanks to a little chat (and a few beers) with Zak at the conference, I
got wondering if this syntax would be a sensible addition...
[...]
syntax:
var [getter method] [setter method] $variable
On Wed, 13 Nov 2002, John Coggeshall wrote:
I understand what your saying, however I guess I see the tradeoff of
creating a new reserved word to a (IMHO of course) kinda messy new
syntax a good one.
Besides, having an absolute standard for get/set would be benefital to
all developers..
Actually looking at this in more detail, the solution PHP has infers
that using $object-XXX='somevar' is heavily prefered over
getXXX()/setXXX(), kind of against the grain for a classic OOP language
(from the impressions have read), As refactoring (which is often the
logic cited for
Thanks to a little chat (and a few beers) with Zak at the conference, I
got wondering if this syntax would be a sensible addition...
The principle is to enable rapid prototyping of getter and setter
methods.
class something {
var getBanana setBanana $banana = 12;
var getOrange
|syntax:
| var [getter method] [setter method] $variable .;
I think this syntax looks pretty interesting. It would allow the
developer to create get/set if desired and doesn't look too strange
either..
I'd like to see it in action myself :)
John
--
PHP Development Mailing List
Very interesting and another syntax suggestion:
var $variable ( getter, setter[, default] );
i havent't took a look in ther parser scripts yet but this seems easier.
Anyway the problem is that you cannot have a setter without a getter.
What about
var $variable ( [get=getter] [set=setter]
Anyway before I get carried away and actually test this :) - anybody got
any thoughts.
Regards
Alan
What's wrong with how overload does this?
SHane
--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php
Shane Caraveo wrote:
Anyway before I get carried away and actually test this :) - anybody got
any thoughts.
Regards
Alan
What's wrong with how overload does this?
it has a slight downside in clarity of code - eg. where is that method..
SHane
--
PHP Development Mailing List
Alan Knowles wrote:
Shane Caraveo wrote:
Anyway before I get carried away and actually test this :) -
anybody got
any thoughts.
Regards
Alan
What's wrong with how overload does this?
it has a slight downside in clarity of code - eg. where is that method..
But it (overload)
|-Original Message-
|From: Shane Caraveo [mailto:shane;caraveo.com]
|Sent: Tuesday, November 12, 2002 10:04 PM
|To: Alan Knowles
|Cc: [EMAIL PROTECTED]
|Subject: Re: [PHP-DEV] prototypes for getters and setters.
|
|
|Alan Knowles wrote:
|
| Shane Caraveo wrote:
|
|
|
| Anyway before I get
variables)...
John
|-Original Message-
|From: Shane Caraveo [mailto:shane;caraveo.com]
|Sent: Tuesday, November 12, 2002 10:04 PM
|To: Alan Knowles
|Cc: [EMAIL PROTECTED]
|Subject: Re: [PHP-DEV] prototypes for getters and setters.
|
|
|Alan Knowles wrote:
|
| Shane Caraveo wrote
Coggeshall
|Cc: [EMAIL PROTECTED]
|Subject: Re: [PHP-DEV] prototypes for getters and setters.
|
|
|the trouble is that you will make pubvar a reserved word, and
|you force
|the user to use a fixed standard for set/get -- eg. some users
|may like
|get_orange, others may want getOrange
|It also
13 matches
Mail list logo