On Thu, Aug 11, 2022, at 3:05 AM, Rowan Tommins wrote:
> On 11/08/2022 01:10, Larry Garfield wrote:
>> Would it be OK if extension methods came*before* normal methods?
>
>
> It would certainly be possible, and seems more logical than allowing
> extensions to over-ride __call but not anything else
On 11/08/2022 01:10, Larry Garfield wrote:
Would it be OK if extension methods came*before* normal methods?
It would certainly be possible, and seems more logical than allowing
extensions to over-ride __call but not anything else. It does lead to a
very different feature, though: it means t
On 8/10/2022 7:17 AM, Alex Wells wrote:
This solution works, but in practice is rarely used. The reasons are:
- there's no IDE completion: `$collection-> ` <- here I want IDE to
auto-complete the `map` method somehow, but since it's a function this is
impossible
This isn't impossible. There's n
On Wed, Aug 10, 2022, at 5:23 PM, Deleu wrote:
> On Wed, Aug 10, 2022, 11:30 PM Rowan Tommins
> wrote:
>
>>
>> To be honest, I put them in that order more for "purity" reasons: if they
>> come before __call, they can change the existing behaviour of the class, by
>> defining an extension method wi
On Wed, Aug 10, 2022, 11:30 PM Rowan Tommins
wrote:
>
> To be honest, I put them in that order more for "purity" reasons: if they
> come before __call, they can change the existing behaviour of the class, by
> defining an extension method with the same name as a "virtual" method
> implemented wit
On 10 August 2022 18:52:58 BST, Alex Wells wrote:
>Thanks for explaining it better than I did.
>
>Regarding the implementation, that was roughly what I was thinking.
>
>But can't we put extension methods second, after real methods but before
>__call? As far as I understand, the reason to put it af
Hi Rowan,
śr., 10 sie 2022 o 19:32 Rowan Tommins napisał(a):
> On Wed, 10 Aug 2022 at 17:18, Ben Ramsey wrote:
>
> > I believe this is also called "monkey patching" in some places, and
> > Ruby, Python, and JavaScript all offer some form of object extension
> > similar to this.
> >
> > There is
Thanks for explaining it better than I did.
Regarding the implementation, that was roughly what I was thinking.
But can't we put extension methods second, after real methods but before
__call? As far as I understand, the reason to put it after __call is to
avoid a performance penalty on __call ca
On Wed, 10 Aug 2022 at 17:18, Ben Ramsey wrote:
> I believe this is also called "monkey patching" in some places, and
> Ruby, Python, and JavaScript all offer some form of object extension
> similar to this.
>
> There is also the PHP runkit extension that provides some of the
> functionality you'
Sorry, replying to all this time :)
I've missed to pinpoint an important fact: extensions don't add methods to
types per-say, rather they allow using them when imported. Extension's
methods would never be called if the extension isn't imported, which is
different from monkey-patching and runkit, w
On 8/10/22 09:17, Alex Wells wrote:
The idea is to introduce extension methods, similar to those in Kotlin, C#,
Dart. For those unfamiliar, those are just regular functions with fancy
syntax. However, I think having those will not only improve readability,
but also cover some of the previously r
11 matches
Mail list logo