Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-03-15 Thread Mark
On Mon, Feb 25, 2013 at 1:17 PM, Clint Priest cpri...@zerocue.com wrote: On 2/21/2013 5:17 AM, David Muir wrote: On 21/02/2013, at 6:12 AM, Lazare Inepologlou linep...@gmail.com wrote: Long code is not always equivalent to readable code. A shorter syntax could improve readability in

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-25 Thread Clint Priest
On 2/21/2013 5:17 AM, David Muir wrote: On 21/02/2013, at 6:12 AM, Lazare Inepologlou linep...@gmail.com wrote: Long code is not always equivalent to readable code. A shorter syntax could improve readability in *some* cases. Long: $users-OrderBy( function( $x ){ return $x-Surname; } );

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-21 Thread David Muir
On 21/02/2013, at 6:12 AM, Lazare Inepologlou linep...@gmail.com wrote: 2013/2/20 Sanford Whiteman swhitemanlistens-softw...@cypressintegrated.com It still looks like some random characters bashed together by a monkey with a keyboard. +1, I am a fiend for ternary expressions and crazy

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-21 Thread Levi Morrison
On Thu, Feb 21, 2013 at 4:17 AM, David Muir davidkm...@gmail.com wrote: On 21/02/2013, at 6:12 AM, Lazare Inepologlou linep...@gmail.com wrote: 2013/2/20 Sanford Whiteman swhitemanlistens-softw...@cypressintegrated.com It still looks like some random characters bashed together by a monkey

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-21 Thread Lazare Inepologlou
2013/2/21 Levi Morrison morrison.l...@gmail.com On Thu, Feb 21, 2013 at 4:17 AM, David Muir davidkm...@gmail.com wrote: On 21/02/2013, at 6:12 AM, Lazare Inepologlou linep...@gmail.com wrote: 2013/2/20 Sanford Whiteman swhitemanlistens-softw...@cypressintegrated.com It still looks

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-20 Thread Derick Rethans
On Tue, 19 Feb 2013, Levi Morrison wrote: Have you considered how this will work/look in an array? $a = [$b = ($n) $m = $m * $n]; // wat. First off, it should be: $a = [$b = ($n) |$m| = $m * $n]; The || make a big difference in this situation. It still looks like some random

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-20 Thread Sanford Whiteman
It still looks like some random characters bashed together by a monkey with a keyboard. +1, I am a fiend for ternary expressions and crazy one-liners, but this makes me want to go back and unroll everything I've ever done into readable code. :) -- S. -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-20 Thread Lazare Inepologlou
2013/2/20 Sanford Whiteman swhitemanlistens-softw...@cypressintegrated.com It still looks like some random characters bashed together by a monkey with a keyboard. +1, I am a fiend for ternary expressions and crazy one-liners, but this makes me want to go back and unroll everything I've

[PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marcello Duarte
Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function Please feedback, -- Marcello Duarte

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Derick Rethans
On Tue, 19 Feb 2013, Marcello Duarte wrote: Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function I'd be really reluctant to add this -- it's yet another (superfluous) syntactical sugar, there is no patch, and how

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Anthony Ferrara
Marcello, On Tue, Feb 19, 2013 at 7:57 AM, Marcello Duarte mdua...@inviqa.com wrote: Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function Please feedback, -- Marcello Duarte I like the concept. I dislike the

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Michael Wallner
On 19 February 2013 13:57, Marcello Duarte mdua...@inviqa.com wrote: Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function Please feedback, Duh, I don't think function(){} is long. -- Regards, Mike

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Paul Dragoonis
I also am not in favour of the syntax, it's too short and quirky. I'm honestly fine with 'function()' it's very explicit On Tue, Feb 19, 2013 at 1:20 PM, Anthony Ferrara ircmax...@gmail.comwrote: Marcello, On Tue, Feb 19, 2013 at 7:57 AM, Marcello Duarte mdua...@inviqa.com wrote:

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Patrick ALLAERT
2013/2/19 Marcello Duarte mdua...@inviqa.com: Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function Please feedback, -- Marcello Duarte BC break detected: ?php { echo foo\n; return bar; }; echo baz\n;

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Bob Weinand
Hi, I don't really like to write every time a long 'function()', only for passing a little callback like 'function ($v) { var_dump($v); }'...: Nice proposal, but writing the last argument outside of the function call could be confusing... An user-function is not a language construct (like

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Florin Razvan Patan
Hello, On Tue, Feb 19, 2013 at 2:57 PM, Marcello Duarte mdua...@inviqa.com wrote: Inspired by Sara, here is another RFC, I finally got around to draft: https://wiki.php.net/rfc/short-syntax-for-anonymous-function Please feedback, -- Marcello Duarte I really don't like syntax for this. It

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marcello Duarte
Thanks for the feedback. I get most people here don't appreciate the value of the feature. I can understand that If you haven't tried to write a tool like capistrano, rspec, chef, puppet, etc, etc in PHP you probably won't see much value in implementing such things. On 19 Feb 2013, at 13:19,

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Lars Strojny
Hi Marcello, Am 19.02.2013 um 14:51 schrieb Marcello Duarte mdua...@inviqa.com: Thanks for the feedback. I get most people here don't appreciate the value of the feature. I can understand that If you haven't tried to write a tool like capistrano, rspec, chef, puppet, etc, etc in PHP you

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Leigh
I can understand that If you haven't tried to write a tool like capistrano, rspec, chef, puppet, etc, etc in PHP you probably won't see much value in implementing such things. Your RFC doesn't go to great lengths to explain the value either. Pretend the reader has no experience with any of

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Arvids Godjuks
I also don't like the RFC proposed syntax. I have to say that I don't really like those short magic-like syntax things in in other languages too. If you work with them on the day-to-day basis and tools are built around those concepts - it's one thing. In PHP syntax is mostly self-explanatory and

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Levi Morrison
There's already been an overwhelming negative reaction to this particular proposed syntax so I won't belabor the point much. In short, this is too similar to block statements and does have BC issues. -- IF (and I stress if) we add a a shorter anonymous function syntax I'd like it to be geared

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Levi Morrison
IF (and I stress if) we add a a shorter anonymous function syntax I'd like it to be geared towards one-liners because that's where the current syntax feels really verbose, especially when you close over other variables: function ($n) use ($m) { return $m * $n; } Versus one potential

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Florin Razvan Patan
Hello, On Tue, Feb 19, 2013 at 6:09 PM, Levi Morrison morrison.l...@gmail.com wrote: There's already been an overwhelming negative reaction to this particular proposed syntax so I won't belabor the point much. In short, this is too similar to block statements and does have BC issues. --

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Morfi
($n) = { echo $n; } ($n) use ($m) = { echo $n; } On Tue, Feb 19, 2013 at 8:11 PM, Levi Morrison morrison.l...@gmail.comwrote: IF (and I stress if) we add a a shorter anonymous function syntax I'd like it to be geared towards one-liners because that's where the current syntax feels really

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marcello Duarte
On 19 Feb 2013, at 16:29, Morfi wrote: ($n) = { echo $n; } ($n) use ($m) = { echo $n; } Morfi, the problem pointed out already is when you have no arguments it would be the same as the statement block, which would cause BC issues. On Tue, Feb 19, 2013 at 8:11 PM, Levi Morrison

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Nikita Nefedov
On Tue, 19 Feb 2013 16:31:39 -, Marcello Duarte mdua...@inviqa.com wrote: On 19 Feb 2013, at 16:29, Morfi wrote: ($n) = { echo $n; } ($n) use ($m) = { echo $n; } Morfi, the problem pointed out already is when you have no arguments it would be the same as the statement block, which

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Levi Morrison
Say we agree on the syntax above ($n) |$m| = $m * $n; What happens when my one liner function needs to do one more operation like checking the value of $n before multiplication? As I stated before suggesting the syntax: It's only meant for a single expression. It's purposefully NOT intended

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Sean Coates
Say we agree on the syntax above ($n) |$m| = $m * $n; What happens when my one liner function needs to do one more operation like checking the value of $n before multiplication? As I stated before suggesting the syntax: It's only meant for a single expression. It's purposefully NOT

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marcello Duarte
On 19 Feb 2013, at 14:16, Leigh wrote: I can understand that If you haven't tried to write a tool like capistrano, rspec, chef, puppet, etc, etc in PHP you probably won't see much value in implementing such things. Your RFC doesn't go to great lengths to explain the value either.

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Yahav Gindi Bar
On Tue, Feb 19, 2013 at 6:40 PM, Levi Morrison morrison.l...@gmail.comwrote: Say we agree on the syntax above ($n) |$m| = $m * $n; What happens when my one liner function needs to do one more operation like checking the value of $n before multiplication? As I stated before suggesting

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Levi Morrison
Have you considered how this will work/look in an array? $a = [$b = ($n) $m = $m * $n]; // wat. First off, it should be: $a = [$b = ($n) |$m| = $m * $n]; The || make a big difference in this situation. Secondly, if you hit a situation where the syntax is confusing, use a less confusing

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Leigh
On 19 February 2013 16:46, Marcello Duarte mdua...@inviqa.com wrote: I find that more and more my developers have to learn ruby just to be able to work in our projects. We are one of the largest PHP shops in Europe and even the proprietary tools we are writing for DevOps stuff we are writing

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marcello Duarte
On 19 Feb 2013, at 17:32, Leigh wrote: On 19 February 2013 16:46, Marcello Duarte mdua...@inviqa.com wrote: I find that more and more my developers have to learn ruby just to be able to work in our projects. We are one of the largest PHP shops in Europe and even the proprietary tools we

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Marco Pivetta
@Marcello: actually, I am also of the idea that there's no real additional value in such a syntax... Since I'm using ZF2 (yeah, that framework that converts array to applications) I am kinda used to have dozens of `function () {}` closures for service factories: so far no problems with it. As

Re: [PHP-DEV] [RFC] Short syntax for anonymous functions

2013-02-19 Thread Christopher Jones
On 02/19/2013 09:45 AM, Marcello Duarte wrote: And just for you is also inaccurate. You will find that the technologies I've been referring to are becoming the tools you will use for DevOps, etc... tasks. Do you guys listen to people outside of internals? It would be good to have a feedback