Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120849 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46032 invoked from network); 19 Jul 2023 12:08:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jul 2023 12:08:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 719A21804FF for ; Wed, 19 Jul 2023 05:08:37 -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, T_SCC_BODY_TEXT_LINE 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-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 19 Jul 2023 05:08:37 -0700 (PDT) Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-345d3c10bdfso29465265ab.2 for ; Wed, 19 Jul 2023 05:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689768516; x=1690373316; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fOFfCmhrfgOLmGjTPWK4nl2RdzvC/u5nqDprVVp2ijA=; b=c13WHvZOCNkMSVhuUkMzL/veltWI47gV3oIJRlGBqvZso1Mm9pAvb+OpNJ+6UJr6is o6IDvtCexH39cqXDKL2kX6YY8PIMcApHANj7OBYs5jeUd0oUeQL8X8TSpBjMana8neq1 3oS1VOzTPG+lbAp6b5AukE+isMXG0ZYpk/bMRL1EqRLmMxQ+6qqpDd5t0xhgz3YP5Z+R idMxwKitbugZqknaml+8ofa4Msf91C7nmLwTLvmaGFIMmeKouRx/RpgrAlHyn11reZxL zwbab4fgrjawsCL4X++F9yLnG298JaIo00+pFoaWrI/1ov82iL3qBSCvFD8Gi05G/zQR ELbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689768516; x=1690373316; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fOFfCmhrfgOLmGjTPWK4nl2RdzvC/u5nqDprVVp2ijA=; b=PGOipjgT0tlLaiUv05vy4dJd8BtUw5J953FcYcYa4/B1/fhJMdCIfK9EXtLhhdOz7u JSrA88abQ20Cf0bD3stI3hPGQ6nu3Zzgiff1g9AD57EYMpCGUWTXV3a3pD06ZdWHPBzB b7i2I6h4b0lvGNhtfChQ8g+n+a5J7AlswfJZjV1vWYAmMDdnzH3tfTP7lZWoEIJbO4fA xhW+jCxE/L9oKnJXh3qMN/pu1OvhcxTky/CLgxmYaH9vz4SriwChicvWET2OzHiO17vU NlGLpuShrAd9j2CmhFI1vBp7A78PbtvY1tfnkV7DInKy2HFHEO949B/SsG6hue1FZDcX kPRw== X-Gm-Message-State: ABy/qLYXrxQzVUQvU525FmQ+1bY+GNJqL2T1WyfDUDD5/WIx8BYvwtZC HuUlBT0GrjbtKpTRQB7wFP7B/4cvxV6xhQkP4yw= X-Google-Smtp-Source: APBJJlEF1nsKpjTAKrcEW8K6eri4OJaFurQyIc3V8DdGmegcAtlluop7VpifuZl3VdTP8FW3EbuSdFPe9M4iTr0JA1k= X-Received: by 2002:a05:6e02:1c4c:b0:348:1a1f:5542 with SMTP id d12-20020a056e021c4c00b003481a1f5542mr6457085ilg.17.1689768516141; Wed, 19 Jul 2023 05:08:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ad5:4204:0:b0:2e2:2af1:79d7 with HTTP; Wed, 19 Jul 2023 05:08:35 -0700 (PDT) In-Reply-To: References: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> <51a97131-f64e-4939-9339-24e70873fe32@app.fastmail.com> Date: Wed, 19 Jul 2023 14:08:35 +0200 Message-ID: To: Larry Garfield Cc: someniatko , php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] pipes, scalar objects and on? From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2023-07-18 18:50 GMT+02:00, Larry Garfield : > On Tue, Jul 18, 2023, at 4:47 PM, Olle H=C3=A4rstedt wrote: > >> Any comment on a pipe (or piped process) as a first-class value? When >> you use |> the functions are immediately applied, which might not be >> what you want. You can lazify it by wrapping it in a lambda, but I >> think that decreases the value of the pipe concept in itself. One >> strength is the ability to split the decision about what to glue >> together from the decision on how to execute it. You kinda get some >> light-weight metaprogramming ability that way. >> >> Well i guess such a pipe-concept is pretty far removed from the simple >> pipe operator. :) And also already possible with existing OOP >> concepts, callable classes, and now the (...) syntax. > > That's the function concat operator I have been mentioning. Concat can b= e > implemented in terms of pipe, and pipe can be implemented in terms of > concat, but I'd rather have both natively. > > For more on my thoughts there, see: > https://peakd.com/hive-168588/@crell/aoc2021-review Right, I think I was thinking more of the pipeline design pattern than the pipe operator. The concat operator will tell you THAT two functions have been glued together, but you have no way to affect HOW they are glued together. With the pipeline design pattern, you do: For example, you could add a logger that logs each input and output in the Pipe class without much hassle. The pipeline design pattern could still greatly benefit from some of these RFCs tho, especially partial function application, I think. Olle