Menu

#2 Question about functions returning functions

open
nobody
None
5
2009-06-24
2009-06-24
No

About functions returning functions –
The handbook on CLISP says : «In Common Lisp, as opposed to Scheme, it is not possible that the car of the compound form to be evaluated is an arbitrary form. If it is not a symbol, it must be a lambda expression.» This explanation corresponds to my experience in trying to code in Lisp.
Nevertheless some Lisp code seems to override this limitation. Maxima is written in Lisp and uses internally some code like « ((mlist simp) 1 2 7 ((mplus simp) $X $Y)) ». Here, the car of a compound form is not a lambda expression but an internal form whose car is an additional symbol defined by Maxima. This internal form evaluates therefore to a function which can be used directly, like a function symbol, without the use of a funcall or apply operator.
I am just curious to understand why and how.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.