Pipe extensions to the language are proposed somewhat frequently. The
answer is almost always the same: making the pipe more complex detracts
from its main feature: simplicity. If we had adopted every proposed pipe
operator so far, we would certainly have more than a handful of them.

Other than that, I think using pipes for a lexical side-effect is
confusing, especially because pipes put focus on data transformations
(rather than data mutation or even scope mutation).

Thanks for the first proposal of the year and happy new year!

*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Mon, Jan 2, 2017 at 12:01 AM, Filip Haglund <fille.hagl...@gmail.com>
wrote:

> I love the flow of how pipelines read top-down as a series of steps, but
> there's something I don't like about it; having to look back at the start
> of the pipeline again to see in what variable the result is stored. It's an
> uncanny valley; reading functional code top-down is really clear and easy,
> but having to jump back up every now and then feels like when developers
> extract single-use functions that really should've stayed inline. It's a
> readibility issue.
>
> I wish the assignment was at the end of the pipeline instead. Equality
> could've worked, but doesn't, since it handles left and right arguments
> differently (illegal pattern, otherwise it'd be great to just put the
> variable assignment at the end, `= b`).
>
> Here's a macro that kinda simulates how it would work.
>
> defmacro into(a, b) do
>   {:=, [line: 1], [b, a]}
> end
>
> Intended demo-usage:
>
> |> (into b)
>
>
> I'd prefer something like `|=>` in place of a pipe
>
> a
> |> fn1
> |> fn2
> |=> b
>
> but this is just a macro right now.
>
>
> What do you think?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/elixir-lang-core/1b11f727-fd6a-4467-8754-5eb4649c432c%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/1b11f727-fd6a-4467-8754-5eb4649c432c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LncqoXVfK%2BNXeTcadEWBttpL5TDo-W9HixJ7xj_C9s%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to