Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 1:57 PM, Rowan Tommins wrote: > > On 25/03/2021 17:14, Mike Schinkel wrote: >> Are you proposing auto-capture but one that is note able to change the >> variable's value in the outer scope? > > > I'm not proposing that, Nuno is. That's what this RFC proposes. Your earlie

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 4:09 PM, Olle Härstedt wrote: > > 2021-03-25 17:49 GMT+01:00, Mike Schinkel : >>> On Mar 25, 2021, at 11:22 AM, Olle Härstedt >>> wrote: >>> >>> 2021-03-25 16:02 GMT+01:00, Mike Schinkel : > On Mar 25, 2021, at 10:41 AM, Rowan Tommins > wrote: >

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Olle Härstedt
2021-03-25 17:49 GMT+01:00, Mike Schinkel : >> On Mar 25, 2021, at 11:22 AM, Olle Härstedt >> wrote: >> >> 2021-03-25 16:02 GMT+01:00, Mike Schinkel : >>> >>> On Mar 25, 2021, at 10:41 AM, Rowan Tommins wrote: On 25/03/2021 12:31, Nuno Maduro wrote: > The reason why w

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 1:19 PM, Chase Peeler wrote: > > On Thu, Mar 25, 2021 at 1:14 PM Mike Schinkel > wrote: > > On Mar 25, 2021, at 12:50 PM, Rowan Tommins > > wrote: > > > > On 25/03/2021 15:02, Mike Schinkel wrote: > >> Can you pl

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 17:14, Mike Schinkel wrote: Are you proposing auto-capture but one that is note able to change the variable's value in the outer scope? I'm not proposing that, Nuno is. That's what this RFC proposes. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Developmen

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 17:11, Chase Peeler wrote: I don't think you should keep a function from developers because some people might use it incorrectly. That is not what I said either. I said I am not a fan of the "fn" syntax, because I do not think auto-capture should be seen as the default. If co

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Chase Peeler
On Thu, Mar 25, 2021 at 10:38 AM Olle Härstedt wrote: > 2021-03-25 15:23 GMT+01:00, Christian Schneider : > > Am 25.03.2021 um 14:29 schrieb Mark Randall : > >> On 25/03/2021 09:28, Rowan Tommins wrote: > >>> That's not quite what I meant. I meant that you can't say "capture by > >>> default, but

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Chase Peeler
On Thu, Mar 25, 2021 at 1:14 PM Mike Schinkel wrote: > > On Mar 25, 2021, at 12:50 PM, Rowan Tommins > wrote: > > > > On 25/03/2021 15:02, Mike Schinkel wrote: > >> Can you please clarify why "function(...) use(...) {...}" can't be > their solution when someone needs by-reference capture? > > >

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and short functions take 2

2021-03-25 Thread Christian Schneider
Am 25.03.2021 um 17:25 schrieb Larry Garfield : > So in conclusion, it seems the reasons closures weren't auto-capture always > were: > > 1) Possible performance concerns that are no longer relevant. > 2) Avoid surprise references. > 3) Allow users to capture by value or by reference. > > Point

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 12:50 PM, Rowan Tommins wrote: > > On 25/03/2021 15:02, Mike Schinkel wrote: >> Can you please clarify why "function(...) use(...) {...}" can't be their >> solution when someone needs by-reference capture? > > > For the same reason - or lack of reason - why it can't be th

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Chase Peeler
On Thu, Mar 25, 2021 at 12:47 PM Rowan Tommins wrote: > On 25/03/2021 15:05, Deleu wrote: > > > * Because it's shorter, people will decide it's the "better" version, > > > when they don't actually need any variable capture. An explicit syntax > > > like "use(*)" instead makes this a deliberate ch

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 16:24, Nuno Maduro wrote: Concerning the comments about what's exactly "auto-captured" by the scope of a multi-line short closure, we will be just reusing the "auto-capture" feature that already exists in one-line short closures. Therefore, this RFC doesn't have plans on changing th

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Matthew Brown
On Thu, 25 Mar 2021 at 12:24, Nuno Maduro wrote: > Hi, > > Concerning the comments about what's exactly "auto-captured" by the scope > of a multi-line short closure, we will be just reusing the "auto-capture" > feature that already exists in one-line short closures. Therefore, this RFC > doesn't

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 15:02, Mike Schinkel wrote: Can you please clarify why "function(...) use(...) {...}" can't be their solution when someone needs by-reference capture? For the same reason - or lack of reason - why it can't be the solution when they need by-value capture. In other words, whateve

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 11:22 AM, Olle Härstedt wrote: > > 2021-03-25 16:02 GMT+01:00, Mike Schinkel : >> >> >>> On Mar 25, 2021, at 10:41 AM, Rowan Tommins >>> wrote: >>> >>> On 25/03/2021 12:31, Nuno Maduro wrote: >>> The reason why we believe the vast majority of PHP Developers are goi

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 15:05, Deleu wrote: > * Because it's shorter, people will decide it's the "better" version, > when they don't actually need any variable capture. An explicit syntax > like "use(*)" instead makes this a deliberate choice. Does this mean you agree that people (PHP users) are very lik

Re: [PHP-DEV] Release Managers for PHP 8.1

2021-03-25 Thread Ben Ramsey
> On Mar 1, 2021, at 11:09, Sara Golemon wrote: > > This is your early, advance warning that RM selection for the PHP 8.1 > branch will be coming up in April. Please start thinking about whether or > not you would like to put your hat in the ring. Feel free to volunteer now, > or any time over t

Re: [PHP-DEV] [RFC] Short functions, take 2

2021-03-25 Thread Larry Garfield
On Thu, Mar 25, 2021, at 12:12 AM, Peter Stalman wrote: > On Wed, Mar 24, 2021 at 5:40 PM Larry Garfield > wrote: > > > In response to the feedback that the savings in typing volume is small, > > that's true but also not the main point. The main point is to allow and > > encourage functions to b

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and short functions take 2

2021-03-25 Thread Larry Garfield
On Thu, Mar 25, 2021, at 12:47 AM, Peter Stalman wrote: > On Wed, Mar 24, 2021 at 10:15 AM Chase Peeler wrote: > > > I guess my one question would be why we didn't support auto-capture when we > > first implemented anonymous functions, and if there was a reason, why does > > that no longer apply?

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Nuno Maduro
Hi, Concerning the comments about what's exactly "auto-captured" by the scope of a multi-line short closure, we will be just reusing the "auto-capture" feature that already exists in one-line short closures. Therefore, this RFC doesn't have plans on changing the way "auto-capture" already works in

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Matthew Brown
On Thu, 25 Mar 2021 at 10:23, Christian Schneider wrote: > Am 25.03.2021 um 14:29 schrieb Mark Randall : > > On 25/03/2021 09:28, Rowan Tommins wrote: > >> That's not quite what I meant. I meant that you can't say "capture by > default, but this variable is definitely local". > > > > I think if t

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Chase Peeler
On Thu, Mar 25, 2021 at 11:23 AM Olle Härstedt wrote: > 2021-03-25 16:02 GMT+01:00, Mike Schinkel : > > > > > >> On Mar 25, 2021, at 10:41 AM, Rowan Tommins > >> wrote: > >> > >> On 25/03/2021 12:31, Nuno Maduro wrote: > >> > >>> The reason why we believe the vast majority of PHP Developers are

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Olle Härstedt
2021-03-25 16:02 GMT+01:00, Mike Schinkel : > > >> On Mar 25, 2021, at 10:41 AM, Rowan Tommins >> wrote: >> >> On 25/03/2021 12:31, Nuno Maduro wrote: >> >>> The reason why we believe the vast majority of PHP Developers are going >>> to >>> appreciate this RFC is because multi-line short closures

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Deleu
> * Because it's shorter, people will decide it's the "better" version, > when they don't actually need any variable capture. An explicit syntax > like "use(*)" instead makes this a deliberate choice. Does this mean you agree that people (PHP users) are very likely to like/enjoy/"think it's the be

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 10:41 AM, Rowan Tommins wrote: > > On 25/03/2021 12:31, Nuno Maduro wrote: > >> The reason why we believe the vast majority of PHP Developers are going to >> appreciate this RFC is because multi-line short closures (aka >> Auto-capturing multi-statement closures) *are mo

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 12:31, Nuno Maduro wrote: The reason why we believe the vast majority of PHP Developers are going to appreciate this RFC is because multi-line short closures (aka Auto-capturing multi-statement closures) *are more simple, shorter to write, and prettier to read *— and the community

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Olle Härstedt
2021-03-25 15:23 GMT+01:00, Christian Schneider : > Am 25.03.2021 um 14:29 schrieb Mark Randall : >> On 25/03/2021 09:28, Rowan Tommins wrote: >>> That's not quite what I meant. I meant that you can't say "capture by >>> default, but this variable is definitely local". >> >> I think if there's one

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Christian Schneider
Am 25.03.2021 um 14:29 schrieb Mark Randall : > On 25/03/2021 09:28, Rowan Tommins wrote: >> That's not quite what I meant. I meant that you can't say "capture by >> default, but this variable is definitely local". > > I think if there's one argument against, this would be it, but IMHO it is a >

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 9:54 AM, Olle Härstedt wrote: > > 2021-03-25 14:29 GMT+01:00, Mark Randall : >> On 25/03/2021 09:28, Rowan Tommins wrote: >>> That's not quite what I meant. I meant that you can't say "capture by >>> default, but this variable is definitely local". >> >> I think if there's

Re: [PHP-DEV] [RFC] Auto-capture multi-line closuresandshortfunctions take 2

2021-03-25 Thread Mark Randall
On 25/03/2021 13:54, Olle Härstedt wrote: JS does not support "definitely local". No language does, AFAIK. Unless you count value types. We were both refering to block-level variables, which most languages do. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Olle Härstedt
2021-03-25 14:29 GMT+01:00, Mark Randall : > On 25/03/2021 09:28, Rowan Tommins wrote: >> That's not quite what I meant. I meant that you can't say "capture by >> default, but this variable is definitely local". > > I think if there's one argument against, this would be it, but IMHO it > is a weakn

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures andshortfunctions take 2

2021-03-25 Thread Mark Randall
On 25/03/2021 09:28, Rowan Tommins wrote: That's not quite what I meant. I meant that you can't say "capture by default, but this variable is definitely local". I think if there's one argument against, this would be it, but IMHO it is a weakness in PHP as a whole. The solution would be addin

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Olle Härstedt
I feel like some of these examples would be better covered by command object pattern and data-transaction objects, instead of FP idioms. wrap_in_buffer pretty clearly so. 2021-03-25 10:28 GMT+01:00, Rowan Tommins : > On 25/03/2021 04:12, Mike Schinkel wrote: > >> Actually, there is a way to declar

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Olle Härstedt
> prettier to read Are they though? Because if it implicitly captures anything in scope, there are more lines to read to figure out what's actually captured. 2021-03-25 13:31 GMT+01:00, Nuno Maduro : > Hi, > > Thank you for the feedback on this thread so far. Programmers are > opinionated, theref

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Mike Schinkel
> On Mar 25, 2021, at 5:28 AM, Rowan Tommins wrote: > > On 25/03/2021 04:12, Mike Schinkel wrote: > >> Actually, there is a way to declare a local variable. Use the long function >> syntax instead as there is no proposal to deprecate it. > > That's not quite what I meant. I meant that you can

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Nuno Maduro
Hi, Thank you for the feedback on this thread so far. Programmers are opinionated, therefore you will find developers that see themselves using this RFC and others who don't. Just like "Fibers", "Type-hints", or any other feature in the language really. The reason why we believe the vast majority

Re: [PHP-DEV] [RFC] Short functions, take 2

2021-03-25 Thread Guilliam Xavier
On Thu, Mar 25, 2021 at 4:23 AM Levi Morrison via internals < internals@lists.php.net> wrote: > [...] > Instead of writing this: > > ``` > class A > { > public function method($arg1) > { > return expr($arg1); > } > } > ``` > > I can write this: > > ``` > class A { > function method($ar

Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and shortfunctions take 2

2021-03-25 Thread Rowan Tommins
On 25/03/2021 04:12, Mike Schinkel wrote: Actually, there is a way to declare a local variable. Use the long function syntax instead as there is no proposal to deprecate it. That's not quite what I meant. I meant that you can't say "capture by default, but this variable is definitely local"

[PHP-DEV] Re: Release Managers for PHP 8.1

2021-03-25 Thread Sergey Panteleev
Hi there, I would like to help as a newbie volunteer too. If possible, my hat's in the ring. — wbr, Sergey Panteleev signature.asc Description: PGP signature