Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Rowan Collins
Larry Garfield wrote on 19/04/2016 16:21: Which is why I'm not sure I like that approach, because the place I then call $handler needs to have a conditional in it. There's another RFC that was posted to Twitter but hasn't made it to the list yet that seems to solve this better: https://wiki.

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Marcio Almada
Hi! 2016-04-19 11:21 GMT-04:00 Larry Garfield : > On 4/19/16 10:02 AM, Rowan Collins wrote: > >> Dmitry Stogov wrote on 19/04/2016 15:48: >> >>> callable-type is much simpler solution for this use-case. >>> Usage of Interfaces to check function prototypes is a bit tricky, but >>> yes, this is a p

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Larry Garfield
On 4/19/16 10:02 AM, Rowan Collins wrote: Dmitry Stogov wrote on 19/04/2016 15:48: callable-type is much simpler solution for this use-case. Usage of Interfaces to check function prototypes is a bit tricky, but yes, this is a possible use-case. Do you like to work with framework, that use this

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Rowan Collins
Dmitry Stogov wrote on 19/04/2016 15:48: callable-type is much simpler solution for this use-case. Usage of Interfaces to check function prototypes is a bit tricky, but yes, this is a possible use-case. Do you like to work with framework, that use this trick for every callback? If you don't

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Dmitry Stogov
On 04/19/2016 05:30 PM, Rowan Collins wrote: Dmitry Stogov wrote on 19/04/2016 15:12: I prefer intuitive concepts, that I may use without rereading manual again and again. For this one, I even can't imagine a natural (not over-designed) use case. The use case that came to my mind is kind o

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Rowan Collins
Dmitry Stogov wrote on 19/04/2016 15:12: I prefer intuitive concepts, that I may use without rereading manual again and again. For this one, I even can't imagine a natural (not over-designed) use case. The use case that came to my mind is kind of the other way around from "syntax sugar for a

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Dmitry Stogov
implement it as a sugar (without VM changes). But may be I didn't understand the idea at all :) Thanks. Dmitry. From: Joe Watkins mailto:pthre...@pthreads.org>> S

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Dmitry Stogov
Joe Watkins mailto:pthre...@pthreads.org>> Sent: Monday, April 18, 2016 13:22 To: PHP internals Subject: [PHP-DEV] RFC: Functional Interfaces Morning Internals, Please review the following RFC: https://wiki.php.net/rfc/functional-interfaces

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Joe Watkins
nction method() : int { >>> return 42; >>> } >>> }; >>> ?> >>> >>> Are $cb1 and $cb2 going to be the same (do the same)? >>> Is this just a new syntax sugar, or a really new feature? >>> >>> According to implementati

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Joe Watkins
to implementation, I think, you shouldn't extend "zend_closure" >> with "interface". >> If this is a sugar, lets implement it as a sugar (without VM changes). >> >> But may be I didn't understand the idea at all :) >> >> Thanks. Dmitry. >

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Joe Watkins
quot;. > If this is a sugar, lets implement it as a sugar (without VM changes). > > But may be I didn't understand the idea at all :) > > Thanks. Dmitry. > > > ________ > From: Joe Watkins > Sent: Monday, April 18, 2016 13

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-19 Thread Dmitry Stogov
M changes). But may be I didn't understand the idea at all :) Thanks. Dmitry. From: Joe Watkins Sent: Monday, April 18, 2016 13:22 To: PHP internals Subject: [PHP-DEV] RFC: Functional Interfaces Morning Internals, Please review the following RFC:

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Sara Golemon
On Mon, Apr 18, 2016 at 12:17 PM, Stanislav Malyshev wrote: > Hi! > >> Please review the following RFC: >> https://wiki.php.net/rfc/functional-interfaces >> An implementation is provided, and is testable on 3v4l. > > This looks like a rather narrow case already covered by anonymous > c

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Marcio Almada
Hi! 2016-04-18 15:17 GMT-04:00 Stanislav Malyshev : > Hi! > > > Please review the following RFC: > > > > https://wiki.php.net/rfc/functional-interfaces > > > > An implementation is provided, and is testable on 3v4l. > > This looks like a rather narrow case already covered by anonymous

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Stanislav Malyshev
Hi! > Please review the following RFC: > > https://wiki.php.net/rfc/functional-interfaces > > An implementation is provided, and is testable on 3v4l. This looks like a rather narrow case already covered by anonymous classes. Am I missing something? What is the added value of it that

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Fleshgrinder
+1 for the feature, very nice syntactic sugar to solve some edge cases. I agree with Rowan, i also do not like the name and propose to call them *closure interfaces*. There are already various synonyms for closures: - anonymous function - lambda function - callback* However, the strongest argume

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Rowan Collins
Joe Watkins wrote on 18/04/2016 12:53: Morning, > I must admit to being a bit confused by the term "functional interface" at first, though, > because "functional" has so many different meanings - is this a term used elsewhere, > or is it up for debate? The terminology is borrowed

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Joe Watkins
Morning, > I must admit to being a bit confused by the term "functional interface" at first, though, > because "functional" has so many different meanings - is this a term used elsewhere, > or is it up for debate? The terminology is borrowed, Java 8 uses lamdas to implement specially

Re: [PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Rowan Collins
Joe Watkins wrote on 18/04/2016 11:22: Please review the following RFC: https://wiki.php.net/rfc/functional-interfaces An implementation is provided, and is testable on 3v4l. This sounds like a really nice feature. As well as using functions to implement existing interfaces, i

[PHP-DEV] RFC: Functional Interfaces

2016-04-18 Thread Joe Watkins
Morning Internals, Please review the following RFC: https://wiki.php.net/rfc/functional-interfaces An implementation is provided, and is testable on 3v4l. Review of the implementation from those of you that do that would be good :) Cheers Joe