2011/8/4 Lazare Inepologlou <linep...@gmail.com>:
> Hello everyone.
>
> I am new to the php-internals list. I have joined because I have
> implemented a feature that I would like to be included in the php
> language: a shorter syntax for lambdas. I am going to briefly present
> it here. Apologies for the long (and yet incomplete) e-mail. I am
> ready to write a more complete RFC in the wiki, however, I would
> appreciate having some directions for that. Do I have to ask for
> permission first? Is it open to anyone to submit an RFC?
>
> The stuff...

Absolutely against such a syntax. Just try to imagine that you have to
actually not only write code, but you have to edit it and it can be
written by someone else.

The syntax we have right now is a bit wordy (is there such a word? :)
), but it makes code easily readable and formatted. Consider
JavaScript - it has function keyword for lambdas and no one is
complaining. Besides it lets you to indent your code beautifully:

$a->select(function($x) {
    return $x->getName();
});

Or like this:

call_some_function(
    $param1,
    $param2
    function ($x, $y) {
        return $x * $y;
    }
);

And so on.

If you write it in one line - it will become ugly one way or other no
matter the syntax.
Just make a Live Template (or whatever it's called in your IDE) for
somethink like "labd" => function (#vars#) { #body } for auto-complete
and be happy.

Is PHP still going the KISS way? PHP does not have different syntax's
for same things except few exceptions witch make sense and didn't
allowed such additions in the past. Please, can I ask the core team to
stay on the same line in the future :)

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

Reply via email to