[PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-05 Thread tyson andre
Hi internals, > > > I've created a new RFC https://wiki.php.net/rfc/deque to add a `final > > > class Deque` > > > > > > This is based on the `Teds\Deque` implementation I've worked on > > > for the https://github.com/TysonAndre/pecl-teds PECL. > > > > > > While `SplDoublyLinkedList` and its subc

[PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-04 Thread tyson andre
Hi internals, > > I've created a new RFC https://wiki.php.net/rfc/deque to add a `final class > > Deque` > > > > This is based on the `Teds\Deque` implementation I've worked on > > for the https://github.com/TysonAndre/pecl-teds PECL. > > > > While `SplDoublyLinkedList` and its subclass `SplQueue

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-03 Thread Larry Garfield
On Wed, Feb 2, 2022, at 9:14 PM, tyson andre wrote: > Hi Larry Garfield, > >> >> Returning $this would resolve that, I think.  (Making it return a new, >> >> immutable copy of the Deque would be even nicer, but I realize that's >> >> probably not an argument I'm going to win at this point on this

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-02 Thread tyson andre
Hi Larry Garfield, > >> Returning $this would resolve that, I think.  (Making it return a new, > >> immutable copy of the Deque would be even nicer, but I realize that's > >> probably not an argument I'm going to win at this point on this RFC.) > > > > Technically, you still can have single-expr

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-02 Thread tyson andre
Hi Jordan, > > 4.  Returning $this makes code easier to write at some cost to readability > > - Developers new to php or using `Collections\Deque` for the first time > > would not immediately know what the code they're reading is doing. > >    (less of a problem with a good IDE, typechecker, and

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-02 Thread Jordan LeDoux
On Wed, Feb 2, 2022 at 6:59 AM tyson andre wrote: > > 4. Returning $this makes code easier to write at some cost to readability > - Developers new to php or using `Collections\Deque` for the first time > would not immediately know what the code they're reading is doing. >(less of a problem w

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-02 Thread Larry Garfield
On Wed, Feb 2, 2022, at 8:59 AM, tyson andre wrote: > Hi Larry Garfield, >> Returning $this would resolve that, I think. (Making it return a new, >> immutable copy of the Deque would be even nicer, but I realize that's >> probably not an argument I'm going to win at this point on this RFC.) > >

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-02 Thread tyson andre
Hi Larry Garfield, > Request: > > push() and unshift() currently return void. That's not helpful. It would be > vastly more useful if they both returned $this. Not as much for chaining, > but more so that you can add a value to a queue and pass it as an argument to > another call (often recu

Re: [PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-01 Thread Larry Garfield
On Tue, Feb 1, 2022, at 8:46 AM, tyson andre wrote: > I plan to start voting on https://wiki.php.net/rfc/deque on Friday, > February 4th. > > Several changes have been made to https://wiki.php.net/rfc/deque#changelog > after the feedback in https://externals.io/message/116100 > > - The class is

[PHP-DEV] Re: Adding `final class Deque` to PHP

2022-02-01 Thread tyson andre
Hi internals, > I've created a new RFC https://wiki.php.net/rfc/deque to add a `final class > Deque` > > This is based on the `Teds\Deque` implementation I've worked on > for the https://github.com/TysonAndre/pecl-teds PECL. > > While `SplDoublyLinkedList` and its subclass `SplQueue`/`SplStack`