On Mon, 8 Aug 2005, Justin Hannus wrote:
> The way ActionScript 2.0 solves this is with set and get keywords on function
> declarations. Any class can contain as many setter/getters as they need,.
> Since we dont want to introduce any new keywords how about something similar
> with __set and __get
Please let me correct my last post, and sorry for the double posting :)
Justin Hannus wrote:
The way ActionScript 2.0 solves this is
function __get fooProp()
{
return $this->_fooProp; // $_fooProp is read only
}
function __set barProp($val)
{
//
...And, this could allow static member overloading as well!
-Justin
Justin Hannus wrote:
The way ActionScript 2.0 solves this is with set and get keywords on
function declarations. Any class can contain as many setter/getters as
they need,. Since we dont want to introduce any new keywords how
The way ActionScript 2.0 solves this is with set and get keywords on
function declarations. Any class can contain as many setter/getters as
they need,. Since we dont want to introduce any new keywords how about
something similar with __set and __get?
_fooProp = $val; // $_fooProp is read only
--- Marcus Boerger <[EMAIL PROTECTED]> wrote:
> Hello boots,
>
> Thursday, August 4, 2005, 6:29:51 AM, you wrote:
> > As far as introspection (points 1 and 2), would it be reasonable to
> > allow __get/__set to be called without any parameters in which case
> > they would be expected to optionally
Hello boots,
Thursday, August 4, 2005, 6:29:51 AM, you wrote:
> Derick Rethans wrote:
>> Problems:
>> 1. There is no way to document the 'virtual' properties with any of
>>the existing documentation tools (such as phpdoc and doxygen)
>> 2. There is no way how the magic methods know if a spec
Derick Rethans wrote:
> Problems:
> 1. There is no way to document the 'virtual' properties with any of
>the existing documentation tools (such as phpdoc and doxygen)
> 2. There is no way how the magic methods know if a specific 'virtual'
>property exists or not as those properties are not
Hello Greg,
Wednesday, August 3, 2005, 4:56:26 AM, you wrote:
> Hi,
> As for the first question of how to document virtual properties, I have
> been recommending that users do this textually inside the docblock for
> __get()/__set(). This is actually ideal in almost every case, as anyone
> u
Hi,
As for the first question of how to document virtual properties, I have
been recommending that users do this textually inside the docblock for
__get()/__set(). This is actually ideal in almost every case, as anyone
using __get()/__set() for finite, concrete properties should almost
defin
Derick Rethans wrote:
class. The magic methods are responsibly for:
- checking if the property actually "exists"
This is something I wouldn't encourage as one of the virtues of fully
dynamic languages is the "lack" of checking this. Otherwise what happens
if e.g. one inherits such a class to
10 matches
Mail list logo