@carstenbauer Less typing, less stuff to track, better composition with a functional style of programming. The first argument position has a special place in julia.
For example threading treats the first position as special. I’ll take your example and pass the results from f to g to h.
x = whatever
f(x, a) |> b->g(x, b, c) |> d->h(x, d)
or
h(x, g(x, f(x, a), c))
vs
@doto whatever
f(a) |> g(c) |> h
end
@doto whatever
h( g( f(a), c))
end
Not really. Which is why I asked for something “like” doto. Nesting, no nesting, different syntax but similar effect, whatever.
I started on something but it had enough annoying corner-cases that I was spending more time on it than it was going to save me! It’s not a simple thing to design, and I don’t think I had it right. I suppose you end up with monads if you think about it long enough.
Actually Transducers.jl might give me what I want. Then I can sort of defer referencing the object to the reducing step and compose whatever methods I need without explicitly referencing the object I want stuff “done” to/with. I’d need to write methods with an arity one smaller ( no object ) for everything.