Anonymous functions, the dot, and parameters

From a practical view variables and function names have basically the same syntax so you need to differentiate between when you want the function name and when you want the value of the variable. So foo(bar) means call the function called foo while foo.(bar) means call the value of the variable foo.

If they have the same syntax then you must be able to differentiate which you mean. As @michalmuskala pointed out that with other languages where the is no difference in syntax you need to be able to differentiate, for example in CL (foo bar) calls the function called foo while (funcall foo bar) calls the value of the variable foo. You could view the . as a short form of funcall. :wink:

11 Likes