Page 1 of 1

Store a function in a variable

Posted: Mon May 07, 2012 4:48 am
by Super_Stinger
Is it possible to store a function in a variable?

I am creating a button with xlib (the button being a struct) and i want to store the function in that button, so when that button is clicked or activated, it will follow through with the function thats stored inside that button

Re: Store a function in a variable

Posted: Mon May 07, 2012 5:06 am
by ramarren
In Common Lisp you can access the function value of a binding with FUNCTION special operator or create an anonymous function with LAMBDA.

You can read a more explanatory explanation than the specification in Practical Common Lisp.