Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93371 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98888 invoked from network); 17 May 2016 12:47:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2016 12:47:11 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.45 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.218.45 mail-oi0-f45.google.com Received: from [209.85.218.45] ([209.85.218.45:36604] helo=mail-oi0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/A1-19201-FC21B375 for ; Tue, 17 May 2016 08:47:11 -0400 Received: by mail-oi0-f45.google.com with SMTP id x201so22370326oif.3 for ; Tue, 17 May 2016 05:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Hm+8wMmFSy0+cdg/Uvo7XZLL0E4NdWPoDjRvjP+zSHY=; b=DCo4QyP8arehDWiVq2qW8+on2j6YIF+TZ/3MOhCQUeDM6dmxZap3H8gZA+lr0cVozD V1DKyjMxXn41BvXwj05hExdVQI19DsQlyJ3Q4TERxl7iuA74pgvh3dul128AaJMv6iID ZQfJDNDDYoV+G/s9aGPCcujarn7lOSn1b5GP+b8N+Af8RgFskAneHlETtOfzZQerLttH GiuanzttcxcmfaC/B5F7LzkCFuHaxmCt3lL7LpJBY6u0dzfFHHfAMQaL3Pq0B0RO4ZA2 kDdrWpplO+NYAnSP3SXGxuD0JPbI9eLP7nn7T999BDN17R1XdeYWlLHSnFLf3TDtNG7w WCUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Hm+8wMmFSy0+cdg/Uvo7XZLL0E4NdWPoDjRvjP+zSHY=; b=Pa++lubTEs8dgfMYAju1ZbQ0CEeEpXRfdTRPTclryqcRhkqKRsy18rxgrdOBm/OObi ATX37A13bmaJTVHy+/ElJhEPXUxu1hMog5v/XiErgyDIo/LbbvwCPkWFAbB0dqrlrCqA //dZq6pG8qOKla9IBLQokRlxxCDzpQDFuFbaHcX73iKU0JosQHn/ObcHaDXQx8VnqMwP gzEnto7IX1f/0+t9j32yKJ8DjtWnciVusxhiRvQwm8SWlLzoxXj2OrlGEdzySlhgT3ez PSrI3k2HgNkELjOgxMC1hvqm551DjWh3w0eIsSIUrIrgeptFOnMWs8nLsUF0ngIw6/8W ln+g== X-Gm-Message-State: AOPr4FUWCXUKXHkR8XmVB6RkUqO8NUZ9b+5SFc4k7fdUcdn+01Qmk9HNWyw71Rwsb4BuPYfKQ+DTpBWGzdfyFg== MIME-Version: 1.0 X-Received: by 10.202.104.133 with SMTP id o5mr602980oik.148.1463489228255; Tue, 17 May 2016 05:47:08 -0700 (PDT) Received: by 10.157.37.57 with HTTP; Tue, 17 May 2016 05:47:07 -0700 (PDT) In-Reply-To: <0d264480-3e55-4765-d6db-eec8dfcb47bf@php.net> References: <98.61.11104.A1D41375@pb1.pair.com> <7c94ca37-e188-dd2b-a66f-bb63bf03041a@gmail.com> <1463008795.1856219.605250569.74618FC4@webmail.messagingengine.com> <92E7F8A8-0845-48A7-91B1-9554C5F66C9D@zend.com> <879feadf-c04e-c0de-826b-110b3eb4e22f@php.net> <85ec320c-b8d6-1cc8-2059-7b8dfa6589e2@php.net> <5739237C.1090605@garfieldtech.com> <33119a72-a146-ea6a-076a-67a886ebdaea@php.net> <0d264480-3e55-4765-d6db-eec8dfcb47bf@php.net> Date: Tue, 17 May 2016 06:47:07 -0600 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary=001a1140a5b29538a6053309236a Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: derokorian@gmail.com (Ryan Pallas) --001a1140a5b29538a6053309236a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, May 17, 2016 at 6:15 AM, Fran=C3=A7ois Laupretre wrote: > > > >> The question of function aliases is not so serious because we'll need ve= ry >>> few. Almost every functions have only one 'natural' argument to >>> substitute >>> as lhs. I'm not sure I understand what you mean with 'but only in certa= in >>> situations'. >>> >>> If it were so natural, wouldn't the original version of these >> functions have been made "right" in the first place? I fear that the >> only thing we'd gain by adding all these aliases is more functions, >> but without the benefit of any improvement in the argument ordering >> problem because now, instead of remembering which order the argument >> is in, users have to remember which alias to call. >> > > Right. That's why I propose we start without creating any function alias. > We're not supposed to allow writing anything in a pipeline. For every > functions, the substituted argument will always be the > haystack|subject|source|input argument. That's easy to remember. > Which I don't think covers many use cases that the Pipe Operator would currently solve. Doing this would lessen its usefulness IMO. Think about common string nesting like: $var =3D substr($var, 0, strpos($var, $othervar)); With current Pipe it would be: $var =3D strpos($var, $othervar) |> substr($var, 0, $$); but your suggestion requires this be kept nested as only haystack is allowed? That totally weakens the proposal in my book. @Sara: Can the place holder be used twice? If its numeric, can I make it negative or perform other math? I don't see anything in the RFC allowing or disallowing such things. Such as: $var =3D strlen($str) |> substr($var, -$$, $$/2) --001a1140a5b29538a6053309236a--