Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113145 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 2034 invoked from network); 11 Feb 2021 18:09:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2021 18:09:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3ECD180504 for ; Thu, 11 Feb 2021 09:55:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 11 Feb 2021 09:55:05 -0800 (PST) Received: by mail-il1-f182.google.com with SMTP id q9so5865752ilo.1 for ; Thu, 11 Feb 2021 09:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5THiol6lzNFpzMdhibDFrIaGbYAaNlzx333Ev2U2+4Y=; b=SGKENKq+4N4zNQOWZbdLMNfPJsiGpt7+0YxgmfjE69cruqDgOS8YynqthNIye4LyJl 3ZfULt/FlVnCktjwsNUoe+AAptW6ysCSQ0xJgcYEHDNn1crU9uCeslrtJGgTXHAOQD3a Rri30HJyDNzv2A5zigipPNIynAzcRUB52en48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5THiol6lzNFpzMdhibDFrIaGbYAaNlzx333Ev2U2+4Y=; b=TDIdF/L2Dzz27HFOFU6/s5qSbxKpWVeiOtCqqDe3zNcKU/dBuIO6v+jmaN4OJjtWCP ot7m7JKq9hj4zdM7YsePbh9Dd6f0ROojU5hpiAWLA3npr6QlzmYgbyQRivHYsmT8rGwq lqE/9pbp/hnONPwmXL0pzZ7I3SklDXgfr1hzE5p5evW6aNc1TczZJurxAyOJFW7GnWmU l4rCDJRy6DhYePzqG55adIy3+dXrwupaY/qIrS7aFEU7d6KOrA6iBWY8GzoIfboekDKT n9pP31uto6MpZjB5+deAY7XHMAeb9wA6Fe8Gra/Z8Bw9ih6leeJspRs1/c8iFWWC9f6T KAmw== X-Gm-Message-State: AOAM531PZeqTbs40LS5qlU2Jv4VEPVDN7jGdgV3JD+R8Lgc9mKsDz3Bu xpLlEQKwZZsH731x4OMs7apBG3pVrhmoT9RVk07g0w== X-Google-Smtp-Source: ABdhPJxAW4ZqVMiBC3NGPEttqUZq7WM93QDNXrFXvjDMuGLllBIhGPtlthKiZVtNKsYXvrhdirqHH/JwEwUoyOy77KU= X-Received: by 2002:a92:6511:: with SMTP id z17mr6642804ilb.232.1613066104304; Thu, 11 Feb 2021 09:55:04 -0800 (PST) MIME-Version: 1.0 References: <60256200.1c69fb81.46e68.6437SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Reply-To: Levi Morrison Date: Thu, 11 Feb 2021 10:54:53 -0700 Message-ID: To: Chase Peeler Cc: Mark Randall , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Proposal: namespace the SPL From: internals@lists.php.net ("Levi Morrison via internals") On Thu, Feb 11, 2021 at 10:48 AM Chase Peeler wrote= : > > > > On Thu, Feb 11, 2021 at 12:23 PM Levi Morrison via internals wrote: >> >> On Thu, Feb 11, 2021 at 9:57 AM Mark Randall wrote: >> > >> > On 11/02/2021 16:39, Levi Morrison wrote: >> > > Let me know what you think. I am hopeful this approach will work bec= ause: >> > > 1. It is focused on a specific area which already has an establish= ed >> > > "namespace", but in name-only (not technically). >> > > 2. It does not try to solve the larger problem, which has a lot of >> > > disagreement. >> > > 3. I will be proposing new types for ext/spl soon (`ReverseIterato= r` >> > > and an array iterator that is more efficient than `\ArrayIterator`), >> > > and Tyson Andre has already proposed `CachedIterable` and company >> > > which is in `ext/spl`, so this space has active development. >> > > >> > > Thank you for your time. >> > > >> > >> > Do you want a dumping ground? Because this is how you create a dumping >> > ground :-) >> > >> > If we're going to start putting things into namespaces (and we should) >> > then we should absolutely avoid repeating the mistakes of the past by >> > dumping completely unrelated things together. >> >> I agree, which is the point of accepting things in a narrow scope. >> Data structures and iterators go hand-in-hand, as many iterator >> implementations are directly connected to the internal implementation >> details of the related data structure. There are other iterators, and >> as long as they are general purpose they are fine too. These things >> are related, not unrelated. >> >> > If SPL\ is to exist (and personally I think SPL is so cancerous, it >> > shouldn't) then IMO it must absolutely be SPL\iterators. >> >> As mentioned in the previous point, iterators and data structures >> belong together. It does not make sense to separate the implementation >> of FixedArray and its iterator into two different namespaces; they are >> one cohesive unit. >> >> Lastly, if we don't adopt a namespace soon, what will new names be? I >> can guarantee it will be something like `SplReverseIterator`, not >> `SplIteratorReverseIterator`. It won't be >> `SplDatastructureCachedIterable`, it would be something like >> `SplCachedIterable` (or `CachedIterable`, ugh). >> >> As you see, "Spl" _is_ the namespace. Any more or any less is >> incongruent with what we have. This is why I am hopeful that >> _specifically_ using "Spl" for these specific types can reach >> agreement; all we are changing is `Spl$thing` to `Spl\$thing`. >> > > I think Spl makes sense (there might be a debate over whether it should b= e Spl or SPL though). How feasible is it to create generate a deprecation n= otice when the global version is used? I assume the hope is to eventually m= ove away from using those, and I don't think that's a horrible BC break giv= en that users have enough time to prepare for it. I don't know the answer to that question. However, I don't think we should add a deprecation on the very first version that we add the aliases anyway. I think that would make for a bad upgrade experience from 8.0 to 8.1. I would leave that more for 8.3, 8.4-ish in the release cycle so there are at least a few versions for people to organically change their code without triggering any notices of any kind. >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: https://www.php.net/unsub.php >> > > > -- > Chase Peeler > chasepeeler@gmail.com