On Thu, 2011-08-04 at 21:18 +1000, Ryan McCue wrote:
> Lazare Inepologlou wrote:
> > Thank you for your interest. This is just a proposal that I have tested and
> > works. Of course, the final syntax can be different. Syntax is always a
> > matter of taste :-)
> 
> As much as I love the idea, I have to agree that using | doesn't really
> make sense here and actually makes the readability worse, IMO. However,
> I can't really think of a better operator. ( $x ) => $x + 1 for example
> would be ambiguous if used in an array definition, but is otherwise the
> best in terms of readability.

If you go there you can also allow more complex statements and re-use
symbols used to group statements, using a syntax like

     ( $x ) { $x + 1; }

Oh wait - now we've reached a point which was mentioned in this thread
already "allow to drop the function keyword".

Back when I proposed to drop "function" a key argument was that people
wanted an easy way to grep for function declarations. I accepted the
validity of that concern and think this might be a case here, too. The
difference of these few characters is not that much but the keyword
gives a clear guidance what's going on, else you might end up with a
long list of random characters next to each other ...

johannes



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

Reply via email to