Re: [PHP-DEV] prototypes for getters and setters.

2002-11-13 Thread Timm Friebe
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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-13 Thread Derick Rethans
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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-13 Thread Andrei Zmievski
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..

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-13 Thread Alan Knowles
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

[PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Alan Knowles
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

RE: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread John Coggeshall
|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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Marcus Börger
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]

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Shane Caraveo
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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Alan Knowles
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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Shane Caraveo
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)

RE: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread John Coggeshall
|-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

Re: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread Alan Knowles
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

RE: [PHP-DEV] prototypes for getters and setters.

2002-11-12 Thread John Coggeshall
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