Huh, its surprisingly fast after compilation! Thanks for adding this! I just was bored and wanted to see if currying was possible! Glad to know that it is. Quite surprised at the results from your macro!
Though, putting sum(1:x) into a function and testing @time f(100) gives 2.8 e-6. A bit faster! Still, not the worst performing macro at all! Thanks for adding to this. On Monday, 1 September 2014 23:20:33 UTC+2, Michael Louwrens wrote: > I just wanted to add an example of function currying in Julia. > > It isn't exactly pretty but it does work! I don't expect it to be > performant however. > > julia> > function Add(x) > return function f(y) > return x + y > end > end > > > Add (generic function with 1 method) > > julia> Add(1)(2) > 3 > > A simple example, but it does show basic currying working fine. >
