Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116102 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29364 invoked from network); 20 Sep 2021 08:00:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Sep 2021 08:00:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2DE631804B2 for ; Mon, 20 Sep 2021 01:41:00 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 ; Mon, 20 Sep 2021 01:40:59 -0700 (PDT) Received: by mail-il1-f170.google.com with SMTP id h9so17749381ile.6 for ; Mon, 20 Sep 2021 01:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=CbyDfEZWBi0Qbe0Yij4higfRguzk4bZrr4QRQ5SbmnM=; b=mwZv5twU1b63LeRDvnqW6kGXzJ87kPU6EKBXgTG8xYQtyVYP9YY7RgZ3tWQSHY99DL fpf9MAeUZGatO/blbHTXVUM95lqm7JBCd7XpHZFszoVA/KWUQM/KKNSDjoO3xdGqUUsk avyZ4VX7XWEOy1werx6nv0DDsa7OLpxM5JdfLmY3TyKaEBmcyZ53e7Fj+cdnPF9WdiDD amS6FeN/LaaVFO/2PlXzWJDowz5wZnF8RQcHOn/nd1oBhuSdmwauZKiikJimS6p2jejh v7f/m5r7O8m5UPgseg5tQBb9fdzJ19N56MsiFFgh/51tj+BVw7rKBvLpOAUIm55dp5LU gNXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=CbyDfEZWBi0Qbe0Yij4higfRguzk4bZrr4QRQ5SbmnM=; b=nzV2bXbKDNPAVlsoeS/wnoqUPTB6gRu+RFfc4Eu3r81HkdNAK1GPLR1QFGpP6uFD7p IMMl+oAPk11Ol65miML5jfkLMbmsU/plgtNnEDVBTALCoD+3VWs6QzXKmiLvoKWdJgwi QAZ90XcyAOnqjO/SqPIlGQWlV7xX9MKiTWApaiyUi0uKlUWl9EuDCoIw/0rBIFtYYRMQ VSfl1CQx1aqWZfHpi4Yfa0JwAF1z0hBfksKNL1/4ZDFyeb/6xQkXfE8rdQG8HukYKJE3 Vk3xN84ofHOEHiZ2PHPiDsWkaqBUDhbdZqCqc1VGTPCl3afvD9oE9NKMnj5Vyt9b9DCq W0sA== X-Gm-Message-State: AOAM531SKEXBrOFS86v9+a7n673ff2VUulVgL9cx4PlHCeQ7NHTF0IF1 DiUjAqff9sbnf/fRPnhrpu1uoug/Nzw= X-Google-Smtp-Source: ABdhPJwoYGje+y5eSKFB+aJjSs4xU/zWMoD06mGfm2R27IVgSvdGiQZaNmL18B4s3a67/JfGGNb9eg== X-Received: by 2002:a05:6e02:1c84:: with SMTP id w4mr5437314ill.219.1632127256735; Mon, 20 Sep 2021 01:40:56 -0700 (PDT) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com. [209.85.166.53]) by smtp.gmail.com with ESMTPSA id o5sm8702329ilk.88.2021.09.20.01.40.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 01:40:56 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id a22so20996989iok.12 for ; Mon, 20 Sep 2021 01:40:56 -0700 (PDT) X-Received: by 2002:a5d:9708:: with SMTP id h8mr17498752iol.170.1632127255726; Mon, 20 Sep 2021 01:40:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 20 Sep 2021 09:40:20 +0100 X-Gmail-Original-Message-ID: Message-ID: To: php internals Content-Type: multipart/alternative; boundary="0000000000004e652b05cc693d99" Subject: Re: [PHP-DEV] RFC: Add `final class Vector` to PHP From: phpmailinglists@gmail.com (Peter Bowyer) --0000000000004e652b05cc693d99 Content-Type: text/plain; charset="UTF-8" Hi Tyson, On Sat, 18 Sept 2021 at 16:46, tyson andre wrote: > Many of php's names are based on the naming choices in libraries made in > C/C++. > So using https://cplusplus.com/reference/vector/vector/ for my RFC > https://wiki.php.net/rfc/vector > seems like the most natural naming choice, > and would make it easier for people with backgrounds in that family of > languages to find the functionality they're looking for. > PHP already has a SplStack, SplQueue, etc, like C++'s `stack`, `queue`, > etc. > That is a fair point. Vector is an overloaded and common word. For me a vector will always default to an entity characterized by a magnitude and a direction, because that's what I learned and used for years. The next definition I learned was the Numpy one. That for me is the sticking point if this Vector allows mixed types which include arrays or vectors. Store them inside a Vector and then you end up with a matrix, a tensor and so-on in something identified as a Vector, which is nonsense. Yes C++ does that [1]. Yes with generics it sort-of makes sense. Numpy gets round it by calling the type `ndarray` and a vector is a specialised one-dimensional array. If it's a high-performance array and that's the goal, call it hparray. Call it a tuple. Call it a dictionary. > Also, your comment is ambiguous. Are you saying that you personally object > to the name, > or that you're fine with the name but think that the comments by > Larry/Chris/Pierre in this email thread are representative of voters. > Both. I object to the name for what's being proposed, but am not necessarily against what's being proposed if it looks more useful than the Spl* stuff. I'm fine with the name but for something other than what's being proposed. HTH Peter 1. https://www.geeksforgeeks.org/vector-of-vectors-in-c-stl-with-examples/ --0000000000004e652b05cc693d99--