Re: [RFC] Pipe Operator
| From: | Sara Golemon | Date: | Thu, 12 May 2016 22:41:20 +0000 |
| Subject: | Re: [RFC] Pipe Operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93297@lists.php.net to get a copy of this message | ||
On Thu, May 12, 2016 at 11:52 AM, François Laupretre <francois@php.net> wrote:
> If we restrict usage to function calls, we can quite easily get rid of the $$ by
> associating to each function the position where the lhs must be inserted
> when used as a 'piped function call'.
>
So we'd have to audit all 4k+ functions in the PHP runtime (and
provide a mechanism for defining it on userspace functions)?
That feels like a LOT of work for an alternate approach to something
which takes much less work as proposed. I'm hoping I misunderstand
what you're suggesting...
> Getting rid of the $$ would resolve most issues about parameter order in the
> existing library, which is probably the biggest PHP sadness.
>
I will admit that anything which alleviates the sadness from argument
ordering in the standard lib will be nice. I'm just skeptical of the
work it'll take to get there.
> My question, before I write a detailed proposal for this, is : do you want
> to keep the possiblility to use *any* expression between pipe operators, or
> would it be acceptable to restrict this to function calls?
>
I'd like to keep the ability to use arbitrary expressions as it keeps
the language overall more consistent. That said, nothing is set in
stone and the point of a discussion period is to discuss. Maybe with
your proposal written out it'll make more sense to me.
-Sara