Function without name... feature or bug?


#1

So I accidentally evaluated something like this to the repl:

function (x)
    :lol
end

>>(::#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?


#2

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


#3

Also see the manual on the topic.


#4

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.