Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-19 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/19/2016 8:47 PM, Chase Peeler wrote: > I don't agree. The HHVM approach of allowing a trait to indicate > the a utilizing class MUST implement an interface is, in my > opinion, not a good thing. It allows the trait to force a utilizing > class t

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-19 Thread Chase Peeler
On Fri, Feb 19, 2016 at 2:42 PM Fleshgrinder wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > On 2/19/2016 8:34 PM, Chase Peeler wrote: > > My comments above, however, were more in relation to the HHVM > > notion of "requires implement interface" which I don't think either > > propo

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-19 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/19/2016 8:34 PM, Chase Peeler wrote: > My comments above, however, were more in relation to the HHVM > notion of "requires implement interface" which I don't think either > proposal does. > I cannot vote but I would like to repeat that the HHV

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-19 Thread Chase Peeler
On Fri, Feb 19, 2016 at 2:13 PM Kevin Gessner wrote: > On Thu, Feb 18, 2016 at 2:16 PM, Chase Peeler > wrote: > >> On Thu, Feb 18, 2016 at 1:29 PM Nikita Popov >> wrote: >> > HHVM already supports "trait Foo implements Iface" with the semantics that >>> the interface is also implemented by the

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-19 Thread Kevin Gessner
On Thu, Feb 18, 2016 at 2:16 PM, Chase Peeler wrote: > > > On Thu, Feb 18, 2016 at 1:29 PM Nikita Popov wrote: > >> HHVM already supports "trait Foo implements Iface" with the semantics that >> the interface is also implemented by the using class. >> >> Additionally HHVM supports a notion of "re

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-18 Thread Chase Peeler
On Thu, Feb 18, 2016 at 1:29 PM Nikita Popov wrote: > On Wed, Feb 17, 2016 at 3:25 PM, Kevin Gessner wrote: > > > Hello internals team! I'd like to propose an RFC to allow traits to > > implement interfaces. > > > > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides >

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-18 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/18/2016 7:28 PM, Nikita Popov wrote: > > Without given an opinion on the RFC itself, this might be > interesting for context: > > http://hhvm.com/blog/9581/trait-and-interface-requirements-in-hack > > HHVM already supports "trait Foo implemen

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-18 Thread Nikita Popov
On Wed, Feb 17, 2016 at 3:25 PM, Kevin Gessner wrote: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. > > I've noticed s pattern in Etsy's code and elsewhere, where a trait provides > a common implementation of an interface. Classes that use the tra

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-18 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 6:13 PM, Levi Morrison wrote: > On Wed, Feb 17, 2016 at 12:48 PM, Kevin Gessner wrote: > > I don't think there is enough benefit from allowing traits to declare > > interfaces, but not propagating the interface out to classes that insert > the > > trait. It does provide

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Levi Morrison
On Wed, Feb 17, 2016 at 12:48 PM, Kevin Gessner wrote: > On Wed, Feb 17, 2016 at 10:26 AM, Levi Morrison wrote: >> >> I want to add my personal experience with traits: every time I create >> a trait it is to implement an interface. Here is a publicly available >> [example with >> OuterIterator](h

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/17/2016 9:01 PM, Kevin Gessner wrote: > > I'm not clear on the motivation for this principle. Is there > anything I could read up about explicit vs implicit in PHP design? > This is not so much about implicit vs. explicit PHP design for me.

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 1:17 PM, Fleshgrinder wrote: > I agree with the others having a class implementing the interface > automatically just because a trait implements it is not a good idea. > The class should always decide on its own if it wants to implement an > interface or not. > I'm not cl

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 10:26 AM, Levi Morrison wrote: > I want to add my personal experience with traits: every time I create > a trait it is to implement an interface. Here is a publicly available > [example with OuterIterator]( > https://github.com/morrisonlevi/Ardent/blob/master/src/Collectio

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Fleshgrinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 2/17/2016 3:25 PM, Kevin Gessner wrote: > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides a common implementation of an interface. Classes that use > the trait are required to also explicitly declare the interface to

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Arne Blankerts
Hi Kevin,   Hi all, On Mi, 2016-02-17 at 09:25 -0500, Kevin Gessner wrote: >  > I've noticed s pattern in Etsy's code and elsewhere, where a trait > provides a common implementation of an interface.  Classes that use > the trait are required to also explicitly declare the interface to > benefit.  

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Markus Fischer
Hello, On 17.02.16 15:25, Kevin Gessner wrote: > I've noticed s pattern in Etsy's code and elsewhere, where a trait provides > a common implementation of an interface. Classes that use the trait are > required to also explicitly declare the interface to benefit. I propose > that traits be permit

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Levi Morrison
On Wed, Feb 17, 2016 at 7:25 AM, Kevin Gessner wrote: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. > > I've noticed s pattern in Etsy's code and elsewhere, where a trait provides > a common implementation of an interface. Classes that use the trai

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
On Wed, Feb 17, 2016 at 9:34 AM, Sebastian Bergmann wrote: > Am 17.02.2016 um 15:25 schrieb Kevin Gessner: > > Hello internals team! I'd like to propose an RFC to allow traits to > > implement interfaces. > > I think that would violate "The Flattening Property" [1], meaning > that the fact tha

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Chase Peeler
I agree. with Sebastian. I'm personally a big fan of using traits as the implementation mechanism for interfaces (i.e. implement the interfaces methods in a trait, then use that trait in a class that implements the interface), but I don't think there is anything positive to gain from having the tra

Re: [PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Sebastian Bergmann
Am 17.02.2016 um 15:25 schrieb Kevin Gessner: > Hello internals team! I'd like to propose an RFC to allow traits to > implement interfaces. I think that would violate "The Flattening Property" [1], meaning that the fact that a class uses a trait must not be noticable by a user of that class.

[PHP-DEV] [RFC] Traits with interfaces

2016-02-17 Thread Kevin Gessner
Hello internals team! I'd like to propose an RFC to allow traits to implement interfaces. I've noticed s pattern in Etsy's code and elsewhere, where a trait provides a common implementation of an interface. Classes that use the trait are required to also explicitly declare the interface to benef