3 ms·
I love the Haskell implementation, since arguments and functions don't need any discernible characters, f 1 2 3 4 5 works just fine. I guess this was one of the
by prezjordan 15y ago
I love the Haskell implementation, since arguments and functions don't need any discernible characters, f 1 2 3 4 5 works just fine. I guess this was one of the original design features of Haskell.
- Drbble 15y agoYup. The tradeoff is that you lose multiple dispatch based on argument list size (overloading) (Clojure, C++, and Java takes the other side of that tradeoff. I don't know if Python has signature-overloading like that.)
- rplnt 15y agoI don't think python has any sort of overloading (based on signature that is). You can use def f(°args, °°kwargs) though. What you'll get is a tuple containing positional arguments and dictionary with keywords arguments. You can even specify some explicitly and then consume all others with this. edit: ° should've been * but I couldn't escape it without using spaces.