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

2022-02-02 Thread tyson andre
Hi Stephen, > As a userland dev & library author it’s nice to see some progression on basic > data structures, so thank you for your efforts on this! > > > Two little things in the RFC: > > The proposed API switches between terms `front`, `back`, `start` and `end` in > comments - is there mea

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

2022-02-02 Thread tyson andre
Hi Mel Dafert, > >The proposed API switches between terms `front`, `back`, `start` and `end` > >in comments - is there meant to be a conceptual difference between > >front/start and end/back ? > > On a similar note, why are the methods for getting the first/last value called > `top()`/`bottom()

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

2022-02-01 Thread Mel Dafert
On 1 February 2022 17:06:59 CET, Stephen Reay wrote: > >The proposed API switches between terms `front`, `back`, `start` and `end` in >comments - is there meant to be a conceptual difference between front/start >and end/back ? On a similar note, why are the methods for getting the first/last va

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

2022-02-01 Thread Stephen Reay
> On 1 Feb 2022, at 21:46, tyson andre wrote: > > 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. >> >> Whi

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

2022-02-01 Thread tyson andre
Hi Levi Morrison, > I think this RFC is in much better shape now. > > The last thing I'll personally push for is dropping `get` and `set`. > I'm not sure about those names, and the functionality is already > provided by `offsetGet` and `offsetSet`, albeit through `mixed` > instead of `int`, but I

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

2022-01-31 Thread Levi Morrison via internals
I think this RFC is in much better shape now. The last thing I'll personally push for is dropping `get` and `set`. I'm not sure about those names, and the functionality is already provided by `offsetGet` and `offsetSet`, albeit through `mixed` instead of `int`, but I think this sort of cleanup sho

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

2022-01-31 Thread tyson andre
> > The name "deque" is used in the standard library of these languages: > > > >  - C++: std::deque > >  - Java: java.util.Deque (interface) > >  - Python: collections.deque > >  - Swift: Collections.Deque (not standard lib, apparently, but Apple > > official? Don't know Swift) > >  - Rust: std::co

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

2021-10-05 Thread Nikita Popov
shFront/popFront but I had > decided against proposing brand new terms > for functionality that already had terms in php-src. > It would also be inconsistent with proposed names for `Vector` if that was > also added. > > https://www.php.net/manual/en/class.ds-deque.php and SplDoubly

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

2021-10-04 Thread tyson andre
he language to have fewer terms and migrate code using SplDoublyLinkedList or arrays - push()/shift() are also shorter names than pushBack/popFront() Thanks, Tyson From: Nikita Popov Sent: October 4, 2021 8:04 AM To: Levi Morrison Cc: PHP internals Subject: Re: [PHP-DEV] Adding `final class Deq

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

2021-10-04 Thread Nikita Popov
On Tue, Sep 21, 2021 at 11:05 PM Levi Morrison via internals < internals@lists.php.net> wrote: > The name "deque" is used in the standard library of these languages: > > - C++: std::deque > - Java: java.util.Deque (interface) > - Python: collections.deque > - Swift: Collections.Deque (not stan

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

2021-09-21 Thread tyson andre
Hi Levi Morrison, > > "Maximum size" shouldn't be an issue for `Deque` specifically, it's a > > `size_t`. It isn't an issue for SplFixedArray and ArrayObject. > > (or for > > PHP would just encounter a fatal error due to either > > You wrote a lot, but unfortunately it was based on a misundersta

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

2021-09-21 Thread Levi Morrison via internals
> "Maximum size" shouldn't be an issue for `Deque` specifically, it's a > `size_t`. It isn't an issue for SplFixedArray and ArrayObject. > (or for > PHP would just encounter a fatal error due to either You wrote a lot, but unfortunately it was based on a misunderstanding. In some languages you ca

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

2021-09-21 Thread tyson andre
Hi Levi Morrison, > The name "deque" is used in the standard library of these languages: > > - C++: std::deque > - Java: java.util.Deque (interface) > - Python: collections.deque > - Swift: Collections.Deque (not standard lib, apparently, but Apple > official? Don't know Swift) > - Rust: std

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

2021-09-21 Thread Levi Morrison via internals
The name "deque" is used in the standard library of these languages: - C++: std::deque - Java: java.util.Deque (interface) - Python: collections.deque - Swift: Collections.Deque (not standard lib, apparently, but Apple official? Don't know Swift) - Rust: std::collections::VecDeque And these

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

2021-09-21 Thread Mike Schinkel
> On Sep 21, 2021, at 1:12 PM, Pierre Joye wrote: > On Tue, Sep 21, 2021, 11:56 PM Mike Schinkel > wrote: > > On Sep 21, 2021, at 3:45 AM, Pierre Joye > > wrote: > > > > On Tue, Sep 21, 2021 at 11:21 AM Mike Schinkel >

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

2021-09-21 Thread Pierre Joye
On Tue, Sep 21, 2021, 11:56 PM Mike Schinkel wrote: > > On Sep 21, 2021, at 3:45 AM, Pierre Joye wrote: > > > > On Tue, Sep 21, 2021 at 11:21 AM Mike Schinkel > wrote: > > > >> Honestly, at first I confused `Deque` with `Dequeue` and was wondering > why we would name a class with a verb? It wa

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

2021-09-21 Thread Mike Schinkel
> On Sep 21, 2021, at 3:45 AM, Pierre Joye wrote: > > On Tue, Sep 21, 2021 at 11:21 AM Mike Schinkel wrote: > >> Honestly, at first I confused `Deque` with `Dequeue` and was wondering why >> we would name a class with a verb? It wasn't until Rowan's comment that I >> realized `Deque` is an a

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

2021-09-21 Thread Pierre Joye
On Tue, Sep 21, 2021 at 11:21 AM Mike Schinkel wrote: > Honestly, at first I confused `Deque` with `Dequeue` and was wondering why we > would name a class with a verb? It wasn't until Rowan's comment that I > realized `Deque` is an abbreviation. > > Which begs the question: how many other PHP

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

2021-09-20 Thread Mike Schinkel
> On Sep 19, 2021, at 8:03 PM, tyson andre wrote: > > 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. With one cav

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

2021-09-20 Thread Rowan Tommins
On 20/09/2021 14:46, tyson andre wrote: The choice of global namespace maintains consistency with the namespace used for general-purpose collections already in the SPL I find this argument unconvincing. If the intention is for this to fit with existing classes in the SPL, it should be called

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

2021-09-20 Thread Pierre
Le 20/09/2021 à 15:46, tyson andre a écrit : Hi Pierre, I'm not certain what you mean by "normalize". https://www.merriam-webster.com/dictionary/normalize mentions At least please try to make it serious, I think you understood what I meant. I'm in no place in arguing about technical details ab

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

2021-09-20 Thread tyson andre
Hi Pierre, > It seems that you are writing more than one RFC to add many data > structures. I love that you're doing that, but I suggest that you'd > normalize them all I'm not certain what you mean by "normalize". https://www.merriam-webster.com/dictionary/normalize mentions 1. "to make confo

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

2021-09-20 Thread Christian Schneider
Am 20.09.2021 um 10:36 schrieb Pierre : > Le 20/09/2021 à 02:03, tyson andre a écrit : >> I've created a new RFC https://wiki.php.net/rfc/deque to add a `final class >> Deque` > > It seems that you are writing more than one RFC to add many data structures. > I love that you're doing that, but I

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

2021-09-20 Thread Pierre
Le 20/09/2021 à 02:03, tyson andre a écrit : Hi internals, I've created a new RFC https://wiki.php.net/rfc/deque to add a `final class Deque` Hello, It seems that you are writing more than one RFC to add many data structures. I love that you're doing that, but I suggest that you'd normaliz

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

2021-09-19 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` exist in the