4 ms·
I think you are misunderstanding. In common Lisp you can call a regular function defined with defun as (foo "something"), but if bar is a variable containing a
by blockmeifyoucan 6y ago
I think you are misunderstanding.
In common Lisp you can call a regular function defined with defun as (foo "something"), but if bar is a variable containing a fuction you have to use (funcall bar " something"). I agree that this is weird and confusing.
- kame3d 6y agoIsn't that the same thing as using function pointers in C? You need the * to access the function the variable points to.
- eigenspace 6y agoSure, 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.
- oalae5niMiel7qu 6y agoNo 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().