语法设计问题

各位大佬,我个问题想请教一下,为什么 |> 函数链接这个语法不能用多参数呢,只能是单参数得函数链接,有些不明白
a |> f1 |> f2 |> f3
其中函数输出输入都是单值或对象,可以
a, b, c |> f1 |> f2 |> f3
其中函数输出输入非单个值或对象,就不可以了,我觉得这个场景也有用得到得时候

因为这个函数就是定义只能接受一个参数,然后应用在单参数函数上。

help?> |>
search: |>

  |>(x, f)

  Applies a function to the preceding argument. This allows for easy function chaining.

函数多返回值会打包为 Tuple,你接受 Tuple 然后自己解包也可以做到传递多参数。

julia> f(x, y) = (x+1, y+1)
f (generic function with 1 method)

julia> g(x, y) = (x*2, y*2)
g (generic function with 1 method)

julia> f(1, 2)
(2, 3)

julia> g(2, 3)
(4, 6)

julia> g( f(1,2) )
ERROR: MethodError: no method matching g(::Tuple{Int64, Int64})
Closest candidates are:
  g(::Any, ::Any) at REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

julia> g( f(1,2)... )
(4, 6)

julia> f(t::Tuple) = f(t...)
f (generic function with 2 methods)

julia> g(t::Tuple) = g(t...)
g (generic function with 2 methods)

julia> g( f(1,2) )
(4, 6)

julia> (1,2) |> f |> g
(4, 6)

julia> (1,2) |> g |> f
(3, 5)

感谢,刚才和人也讨论了,下面这种会产生歧义,就是当其中一个函数接受单个元组时。所以两种方式没办法合到一个运算符了,只能分开了