Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111764 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24364 invoked from network); 1 Sep 2020 16:01:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Sep 2020 16:01:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 80CC51804D4 for ; Tue, 1 Sep 2020 08:05:42 -0700 (PDT) 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-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 ; Tue, 1 Sep 2020 08:05:41 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id b6so1058763iof.6 for ; Tue, 01 Sep 2020 08:05:41 -0700 (PDT) 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=BpJCiryJcS8wIvLqCHkxOjt+ZKqhXH5Y75SW5ATt42c=; b=c3tLVtJ7DnNyek4RVeDG/8qjl5OLUapOX01pxIXOLCMr7mPfYik7hDYCbSW76HeMXI nn6W02GV8us+xdZqdT3/OQFFCt/VxG7erihAzTFAomeS7BGW/lp1XQWwq5IeSHAiCVSU 7iPLW1hBCVHY2uWTNGXLqmEVJ3aDsEJn4o+q8= 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=BpJCiryJcS8wIvLqCHkxOjt+ZKqhXH5Y75SW5ATt42c=; b=L/NJjMNvGUJ93Kdz4ifXxOU4qhhCe3Hah4HEn/RsT3SbtfWMXGJumwWZ6M33d2KJ9I tEMhQwGNAx4tmbh1jsckYnZR2EU5osy07J/SvZVMQP8woHA27ka7AadkFX+KS4ye7xuL 6hIFpfefLOb3MyWePtz8UMxQ/jOKwMhKbzLFSjpkaaMjC075sDl4VRM5LZlNEBdJtQ7e yC3kLk67WLl2+Q89AIACwN3mNU0swa5P9rVfo6BBcnjs4jIboQPDEcy/F5DgBs1Aam7A /vVQnPVaEuW3X7R0EBBUP+3RTaRhmf7cbjHHSzhaWPYJSRegDneWrkYWV8WWx7S7O6/a OE/w== X-Gm-Message-State: AOAM532ziuOT3bs+2lV1HY/ZMXLCqRIdcljWbhkBOEEGJueOiHrdGt9D MwIJq5FJlxtcCyafk3a5bUUonN1ADn/i8TmqfQfKcQ== X-Google-Smtp-Source: ABdhPJzwRE3xgSJUy3DCy3nXCSbFVDYaM2uyU0ApKeYWKasARnrzuytvDoHOXz/miD1eXpfGvg+8JLcOUGRPjq9WAXY= X-Received: by 2002:a02:852c:: with SMTP id g41mr1810826jai.58.1598972740256; Tue, 01 Sep 2020 08:05:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Tue, 1 Sep 2020 09:05:29 -0600 Message-ID: To: Peter Bowyer Cc: Marco Pivetta , Nikita Popov , tyson andre , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Global functions any() and all() on iterables From: internals@lists.php.net ("Levi Morrison via internals") On Tue, Sep 1, 2020 at 2:08 AM Peter Bowyer wrote: > > On Tue, 1 Sep 2020 at 08:59, Marco Pivetta wrote: > > > Did the namespaces ship sail forever? Can we just have those instead, > > please? > > > > To mix metaphors: it sailed, shot down in fiery flames. > > Unfortunately. > > Peter If we add significantly more functions to the proposal (which makes it riskier from a time investment standpoint), then I think the case for a namespace makes sense. Nobody wants to add a namespace for one or two things. If there are 10+ things it's a bit more convincing. This is a case where having a proposed API and impl in PHP-land is probably sufficient enough to make an RFC vote; the conversion to C can happen if it passes. Here is a sampling of functions from my own (private) iterable library: - all_values - any_value - no_value - one_value - to_iterator - filter_values - for_each_value - map_values - reduce_values - zip_values The values suffix is because there are variants that work with more than just the values. Being value-centric is great, but we must leave design room for the rest for when they are needed. Anyway, the key point I'm making is that I think a larger RFC has a better shot of passing if we want to namespace it.