3 ms·
That's beautiful, the linear pipeline better matches your intuition about the computation than the nested functions. Can we have this in C# 7? :)
by radicalbyte 11y ago
That's beautiful, the linear pipeline better matches your intuition about the computation than the nested functions.
Can we have this in C# 7? :)
- danbruc 11y agoThis essentially exists - extension methods.
- radicalbyte 11y agoExtension methods only apply to instances and they must be declared explicitly. This syntax can be used anywhere as long as the types signatures of the functions are conducive to the chaining.
- danbruc 11y agoNot sure what you mean with applying only to instances, in which case couldn't you use an extension method? If you own the code making a function an extension method seems not a big deal. If you want to invoke a static function you don't own the code for then you could have a generic wrapper extension method which admittedly would probably look rather clumsy and nullify the desired gain in readability.
- mateuszf 11y agoBut you have to write them before using. It's not needed in case of the discussed feature.