Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112779 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26878 invoked from network); 6 Jan 2021 15:14:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jan 2021 15:14:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D7E31804E2 for ; Wed, 6 Jan 2021 06:50:56 -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-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 ; Wed, 6 Jan 2021 06:50:55 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id q137so2960640iod.9 for ; Wed, 06 Jan 2021 06:50:55 -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; bh=avmMyikc62atKe1+diCgqHWQratZOMwI6Z9mqsuwLpM=; b=hudeTSZDk8lt7P5SHknDgmyrehqDFNhEqGWcroYJ7E3qZLVqmjrzj8bSq4QmNrwYJq dvNwhCQceGGMfnbRdGm/07O4yn82g9gFqh3ssFZd0FfEe0C3CJiCPA8obxoMdalOoBXE 1b3qwhIJizbHjbtxg8aMmWUY/uvaj854UjJIs= 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; bh=avmMyikc62atKe1+diCgqHWQratZOMwI6Z9mqsuwLpM=; b=gQI0vt4L2eG/hWOQZauWekOXAhfy4rrmaJZy82a31nSNuC6O/6jtNpjGNfGZgaU7jo q6yNhjHHaxhxvgkp3FSO0pQEaom4vofwfj6W5BHvYdyBxIyDBBOe5Oeasp4wE4VvHBnq AhWdrUXlEVPGQoki6vY4cQNUN4d7dIJcDGQA+0lmG0HNOEroXMG7NHdy9EUBJdSSsOBO rdJ7JZVNJhHyrcO11qcuZVHNUJvLBHAc60UUIkK0qvXmzfD114qYhKc9fVZASafM/eI9 PT7IdSKJPvqgSTF2DY98vEAtDFxKonfcCGxj/x7xHvFw3cD752r8JPjM8uKU1InUMtiM PmAg== X-Gm-Message-State: AOAM530xLqOYe0ms4JM9Sje1nuYsUlEcGD9sbeE4rvmqG/MbrcZZRxbu pBz/4qKWqZ6HkoTBqT+iKJLWCqUQtWUCI6OzzeUjtw== X-Google-Smtp-Source: ABdhPJyqzrc6BaFgzp1GNaHf5g9kV37hiRK81ZTMg9P42TTE67kKVQwMIF9qX0V+cG59AE+mYQDm70V6jyo8lSgCkqU= X-Received: by 2002:a5e:990c:: with SMTP id t12mr3206827ioj.177.1609944654642; Wed, 06 Jan 2021 06:50:54 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Wed, 6 Jan 2021 07:50:43 -0700 Message-ID: To: Nikita Popov Cc: tyson andre , "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: Straw poll: Naming for `*any()` and `*all()` on iterables From: internals@lists.php.net ("Levi Morrison via internals") On Wed, Jan 6, 2021 at 7:39 AM Levi Morrison wrote: > > On Wed, Jan 6, 2021 at 1:55 AM Nikita Popov wrote: > > > > On Wed, Jan 6, 2021 at 2:28 AM tyson andre > > wrote: > > > > > Hi internals, > > > > > > > I've created a straw poll for the naming pattern to use for `*any()` and > > > `*all()` on iterables. > > > > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll > > > > > > > > Background: The RFC https://wiki.php.net/rfc/any_all_on_iterable > > > proposes adding only two functions, > > > > but more functionality acting on iterables (array|Traversable) may be > > > added in the future, > > > > making it important to get feedback what people feel the best choice of > > > naming pattern would be > > > > to avoid inconsistency or name changes later on. > > > > (Many alternatives were suggested in the initial RFC announcement - > > > https://externals.io/message/111756) > > > > > > I've received more feedback than I expected from voters that were strongly > > > or moderately > > > in favor of putting new categories of functionality in namespaces. > > > > > > I've started a different straw poll and plan to start voting on that on > > > the 8th (this will be the last straw poll for iterable function naming for > > > this RFC) > > > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll_namespace > > > > > > 1. I plan to propose additional internal functions for working with > > > iterables if this succeeds, > > > and would want to be sure this is the best name choice instead of just > > > an acceptable name choice going forwards. > > > 2. Additionally, this has been an opportunity for measuring overall > > > interest in adopting namespaces for brand new categories of functionality. > > > It can be argued that this is a new category of functionality because > > > existing methods work on Traversables (iterator_*) or arrays (array_*), but > > > generally not both. > > > (classes such as https://www.php.net/manual/en/class.ffi-cdata.php have > > > adopted namespaces, > > > but no global functions in php-src that I'm aware of have adopted > > > namespaces yet) > > > > > > > I'm happy to have these functions namespaced, but I'm not sure the > > suggestion to namespace them under Spl makes sense. This functionality has > > fairly little to do with the SPL as it is now and to be honest, by now > > there is quite a bit of ... stigma associated with functionality that > > resides in SPL. > > > > I would suggest using iterable\any and iterable\all as the names if we want > > to go down this route. iterable_any and iterable_all were the by far most > > popular choices on the previous poll, and these are just the namespaced > > variants thereof. > > > > Regards, > > Nikita > > On the contrary, I'm happy to accept it into the SPL. I don't want the > SPL to be a dumping ground for everything, but I specifically > requested it to be an option for this vote. I forgot to mention that I plan other additions to the SPL for 8.1, such as: - ForwardArrayIterator - ReverseArrayIterator - to_iterator(iterable): Iterator -- this needs ForwardArrayIterator for efficiency I plan to stick all of these in the SPL namespace.