On 29/04/2021 10:25, Christian Schneider wrote:
Without a keyword like "var" to declare it, I think most users would assume that an
initialisation like "$foo=null;" at the top of their closure would make a variable local.
This assumption by the users would be true as we are capturing by value,
Am 29.04.2021 um 10:14 schrieb Rowan Tommins :
> On 28/04/2021 23:00, Nuno Maduro wrote:
> 3) All variables are captured, there is no local scope. This is effectively
> what PHP's single-expression closures use.
>
> Option 3 is the easy option, and is currently "good enough" because it's rare
>
On Thu, Apr 29, 2021 at 12:00 AM Nuno Maduro wrote:
> On Wed, 28 Apr 2021 at 15:31, Nikita Popov wrote:
>
>> On Wed, Mar 24, 2021 at 5:20 PM Larry Garfield
>> wrote:
>>
>> > Greetings, Internalians.
>> >
>> > Some months back I proposed an RFC for short functions.
>> >
>> > https://wiki.php.net
On 28/04/2021 23:00, Nuno Maduro wrote:
Concerning point 2: Developing some sort of static analysis that can infer
what needs to be captured may be problematic. First, that won't be
consistent with the way auto-capture currently works in PHP (one-line short
closures).
The question is, how do w
On Wed, 28 Apr 2021 at 15:31, Nikita Popov wrote:
> On Wed, Mar 24, 2021 at 5:20 PM Larry Garfield
> wrote:
>
> > Greetings, Internalians.
> >
> > Some months back I proposed an RFC for short functions.
> >
> > https://wiki.php.net/rfc/short-functions
> >
> > After some discussion, I put it on h
On 28/04/2021 15:31, Nikita Popov wrote:
My suggestion would be to allow use(&$count) on fn(), which allows capturing
certain variables by reference rather than by value.
It might be rather confusing for the use block to sometimes mean
"capture exactly these variables", and sometimes mean "c
On Wed, Mar 24, 2021 at 5:20 PM Larry Garfield
wrote:
> Greetings, Internalians.
>
> Some months back I proposed an RFC for short functions.
>
> https://wiki.php.net/rfc/short-functions
>
> After some discussion, I put it on hold to ensure that it was compatible
> with the other discussion floati
On Wed, Mar 24, 2021, at 11:19 AM, Larry Garfield wrote:
> Greetings, Internalians.
>
> Some months back I proposed an RFC for short functions.
>
> https://wiki.php.net/rfc/short-functions
>
> After some discussion, I put it on hold to ensure that it was
> compatible with the other discussion f
On 25/03/2021 16:25, Larry Garfield wrote:
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.
I wasn't involved in th
On 24.03.2021 17:19, Larry Garfield wrote:
> 1) The updated short-functions RFC: https://wiki.php.net/rfc/short-functions
> 2) A new RFC, code by Nuno, for auto-capturing multi-statement closures:
> https://wiki.php.net/rfc/auto-capture-closure
I'm not sure just the keyword (`fn`) should indicate
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
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?
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?
>
I believe this was the original discussion:
https://externals
On Wed, Mar 24, 2021 at 9:20 AM Larry Garfield
wrote:
> 1) The updated short-functions RFC:
> https://wiki.php.net/rfc/short-functions
>
> 2) A new RFC, code by Nuno, for auto-capturing multi-statement closures:
> https://wiki.php.net/rfc/auto-capture-closure
>
> These are separate RFCs and at th
On Wed, Mar 24, 2021, 17:20 Larry Garfield wrote:
> Greetings, Internalians.
>
> Some months back I proposed an RFC for short functions.
>
> https://wiki.php.net/rfc/short-functions
>
> After some discussion, I put it on hold to ensure that it was compatible
> with the other discussion floating a
On 24/03/2021 17:33, Christian Schneider wrote:
My guess would be that it was seen as one of PHP's big strength that variables
don't just leak into other contexts but that it has to be done explicitly.
Now with arrow functions both the benefit of auto-capturing is bigger compared
to the actual
On Wed, Mar 24, 2021 at 1:34 PM Christian Schneider
wrote:
> Am 24.03.2021 um 18:15 schrieb Chase Peeler :
> > 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?
>
Am 24.03.2021 um 18:15 schrieb Chase Peeler :
> 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?
My guess would be that it was seen as one of PHP's big strength that vari
On Wed, Mar 24, 2021 at 1:02 PM Nikita Popov wrote:
> On Wed, Mar 24, 2021 at 5:20 PM Larry Garfield
> wrote:
>
> > Greetings, Internalians.
> >
> > Some months back I proposed an RFC for short functions.
> >
> > https://wiki.php.net/rfc/short-functions
> >
> > After some discussion, I put it on
On Wed, Mar 24, 2021 at 5:20 PM Larry Garfield
wrote:
> Greetings, Internalians.
>
> Some months back I proposed an RFC for short functions.
>
> https://wiki.php.net/rfc/short-functions
>
> After some discussion, I put it on hold to ensure that it was compatible
> with the other discussion floati
20 matches
Mail list logo