On Thu, Aug 4, 2011 at 09:12, Antony Dovgal <t...@daylessday.org> wrote:
>>>  Btw, am I the only one to whom the proposed syntax seems kinda
>>> hieroglyphic?
>> No. I don't see at all why we need this, just like I don't see why we
>> needed an alternative (short) syntax for arrays. This kind of syntax
>> additions that add *no* functionality, should not be in PHP.
> Yes, I believe we should stop this stream of alternative syntax proposals
> and concentrate on fixing existing functionality instead of adding less 
> readable ways to do
> the same thing. I would really like to keep PHP code easily readable, not to 
> turn it into
> perl-ish write-only gibberish.

100% agreed, both about the cryptic nature of the proposed syntax and
the need to focus on fixing existing issues. Strong -1 on a new
syntax.

The current PHP syntax for closures is the second-best one I've ever
used, IMHO. Clear, readable, explicit. My all-time favorite syntax is
that favored by Objective-C:

^ [returntype] ([params]) { code; }

The compiler figures out at build time which lexical stuff to capture,
and in most cases can infer the optional return type. I'd kinda love a
^ (params) use (captures) { code; } syntax in PHP, but nothing any
less wordy than that, and I'd hardly consider it any kind of priority.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to