Meet some mind-blowing ways to define functions in Julia: a tour of the many ways to create functions in Julia

 #JuliaLang

https://medium.com/@evalparse/there-are-so-many-ways-to-define-a-function-sort-of-in-julia-7821e49373cd

Meet some mind-blowing ways to define functions in Julia: a tour of the many ways to create functions in Julia

The weirdness witnessed below is taken from https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816/16 Well, almost, there is a very subtle difference. If you define a function…

Medium
@mhsatman `a*b = a+b` this is nuts!

@atsyplenkov yeah it's insane. I like

(::Int)(y)=2y

so we can

10(5)

and get 10

🤡

@mhsatman @adam_wysokinski
That was surprisingly informative - thanks!