[PROPOSAL] Pipe operator enhancement

150 views
Skip to first unread message

Aleff Souza

unread,
Aug 15, 2016, 11:51:40 AM8/15/16
to elixir-lang-core
We all know that the pipe operator is very powerful and elegant, but what I think that is annoying sometimes is that it ONLY passes the result to the FIRST parameter of the next expression. So, I think it'd be nice to have some way where I could choose which parameter the left result would be passed. 

In Example, given a function foo/3:

"Elixir"
|> String.upcase
|> foo(param1, _, param3)

Where '_' is where the result from the previous expression would be passed on.

José Valim

unread,
Aug 15, 2016, 11:55:33 AM8/15/16
to elixir-l...@googlegroups.com
Hello Aleff,

Proposals that enhance the pipe operator such as this one has been sent multiple times in the past. I recommend you to read the archives and see why they were rejected. If previous proposals were not exactly as this one, the reasons for rejection likely stand.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b07c635a-0155-44f2-8fb3-b996f4d33fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Theron Boerner

unread,
Aug 15, 2016, 11:56:21 AM8/15/16
to elixir-lang-core

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.

Aleff Souza

unread,
Aug 15, 2016, 1:16:31 PM8/15/16
to elixir-lang-core
Hello Valim,

Thanks for your quick reply. I'll check the archives asap.

Onorio Catenacci

unread,
Aug 16, 2016, 1:26:00 PM8/16/16
to elixir-lang-core
@Theron 

+1 for the excellent list of past discussions on this topic!

--
Onorio
Reply all
Reply to author
Forward
0 new messages