4 ms·
Another nice thing about the pipe is that you can pipe into any function, not just the methods associated with the object that I’m working with. If I write my
by wodenokoto 8y ago
Another nice thing about the pipe is that you can pipe into any function, not just the methods associated with the object that I’m working with.
If I write my own function four() I end up with
Four(x.one().two().three()
But with pipes you get to keep the left-right reading order:
X | one() | two() | three() | four()
(Sorry for poor formatting. Can’t find the backtick on my mobile keyboard.)
- apta 8y agoLanguages that have UFCS or extension methods also support this.