Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114602 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6380 invoked from network); 25 May 2021 20:47:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 May 2021 20:47:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A8718180507 for ; Tue, 25 May 2021 13:59:01 -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,FREEMAIL_FROM, 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-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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, 25 May 2021 13:59:01 -0700 (PDT) Received: by mail-qv1-f41.google.com with SMTP id z1so16788082qvo.4 for ; Tue, 25 May 2021 13:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DwDdtIt71U9ORgYt/CHBxqyOfVVuCv5DeXMS9FH4uM8=; b=E6dT5es+X8FjvWrs+yVGEANl4ztRkOBOLw5hViDSz/qFKgxCYk+c+OgyX8jSrqmv8A /wV7/xnkXIJuMAbG37ZX/FwmPfrlfl0gokqjnFx++OsV8rD/gLQ/ywNwnVr9v2oU4dkp Jpoh66yNqog2w0FStTklBdiHMocDsAY0OwhXiGlevuSI8OyMuylNEI/2sSRO1xw4lLwU 4ShgaU06xswodPCHneff+JWMy5xCiVrJ2kH1gIXWlZ5pQ5NKxrJcz/GQ8uk7lyfbhaaA 8brYFut59wZVmuMOjZh9Fcz2pVqmJWUb54yALKFwW98uGen9wMt9AzEyF5xlkZE7c6E/ N4+g== 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=DwDdtIt71U9ORgYt/CHBxqyOfVVuCv5DeXMS9FH4uM8=; b=FvFlO7XISA5gcTvQLbFqRTpxZ6UN0sMahizyF4lPQKNzaQP7Ewxaegsaql4KC4/jpw Dvoq1S60xLFt4BUrme9Lr1Lo9F55jiS5h0aaXgbw5DWFp9AIy0XOKJ9bDpn2zOynJ8Ce YHaYjiTr2lO0ZhEepvF/McOjUdnXagiyqiW7tDsrrU6U71AXRzKMhg0IrAmbV6NS1pVk 07XND772pnXJ6Qm8eQhpMnOMin92EjBX0gZ4MyJ9w1W0p78BWn7qwpV7G8yGFAJ2/xF6 Ml9lg3lsDEzRf1nMIEXcb69dpkNXg8xyKDX42e7rZHAoTm5W1jNoo7TjmMZt57ce26rZ neZw== X-Gm-Message-State: AOAM532QZHLTd3XkwuNsmc91t77nAy985lrMLcPPntLeGzwPL8FHIhby N13WVnxKy8jncOYW3613ZDaXyK36kAQsSQnmkEY= X-Google-Smtp-Source: ABdhPJxy4lv3tRirT5lTzgPkBF8GA9JKEyRGxrUCVgTckFNABWJbbsms7gZAKsqDHQqYZFwMnvw0vjdc12gUc75gsPo= X-Received: by 2002:a0c:8d44:: with SMTP id s4mr28196080qvb.43.1621976337469; Tue, 25 May 2021 13:58:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 26 May 2021 03:58:46 +0700 Message-ID: To: someniatko Cc: Karoly Negyesi , Marco Pivetta , Lynn , "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] A little syntactic sugar on array_* function calls? From: the.liquid.metal@gmail.com (Hendra Gunawan) Hello. > > ```php > $array|>map($fn1, ?)|>filter(?, $fn2); > $array->map($fn1)->filter($fn2); > ``` > Whitespace removal is not a solution for code length problems. You might have a new problem if you do it. "|" is very similar to the lowercase "L" and uppercase "i". It's just an extra 3 characters (", ?" or "?, "). For most people, this is not a problem at all. people tend to write "one statement per line" rather than "multi statement line". I myself usually write no more than 3 statements per line if they are less than 120 characters. The real problem is there is no consistency for "haystack vs needle" position. There are RFCs to fix this (along with the naming convention problem), but none of them are successful. > The pipe operator feels like a poor solution while "->" would do > exactly what people want. Not so poor if we * use "~>" as pipe operator rather than "|>" * redesign the api under their proper namespace and strictly place the "haystack" as the first function argument. Regards, Hendra Gunawan.