This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Store a function in a variable

2 posts · 1665 views

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

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.