Hacker News new | ask | show | jobs
by kame3d 2022 days ago
Isn't that the same thing as using function pointers in C?

You need the * to access the function the variable points to.

2 comments

No you don't. You call the pointer itself. It points to the first instruction in the function.

It's more like Ruby's method(:foo) and .call().

Sure, this isn't that rare of a thing for languages, but it is increasingly rare to find people who think this is a good idea.