Function without name... feature or bug?


So I accidentally evaluated something like this to the repl:

function (x)

>>(::#25) (generic function with 1 method)

If I evaluate it repeatedly 25 increments to 27, 29, 31 etc. which I guess is kinda cool but maybe a bug or otherwise totally bizarre feature?


Functions without names are called anonymous functions. They’re just rarely written out in “long” form.


Also see the manual on the topic.


I see. Or rather, I wonder why I didn’t see before, as I am familiar with anonymous functions, but never created one using that syntax.