Re: Proposal: shorthand object property setting syntax.
| From: | Stefan Marr | Date: | Sat, 27 Mar 2010 16:57:30 +0000 |
| Subject: | Re: Proposal: shorthand object property setting syntax. | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47659@lists.php.net to get a copy of this message | ||
>> However, the proposal reminds me of Pascal's 'with'-construct:
>>
>> new(pointertob);
>>
>> with pointertob^ do
>> begin
>> a := 10;
>> b := 'A';
>> c := nil
>> end;
>
> Can one do something like "b := this.a"? This sounds like a huge can of
> worms to me.
Ehm, I don't see what might be problematic with "b := this.a".
However, I did not mean to propose it, I just thought I mention it.
Think there was also a similar discussion (with respect to something similar to 'with') a
while back.
But since PHP requires you to write your '$this->' everywhere, such a construct does
not feel very much inline with this rest of the language which is explicit.
Back to the original proposal, from my point of view, source code is meant to be read, and
repetition is handled easily by the human brain, a bit of alignment with whitespace and voilà...
Best regards
Stefan
>
> - Martin
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: +32 2 629 3525