Store a function in a variable

Discussion of Common Lisp

Store a function in a variable

Postby Super_Stinger » Mon May 07, 2012 4:48 am

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
Super_Stinger
 
Posts: 5
Joined: Wed May 02, 2012 3:49 am

Re: Store a function in a variable

Postby Ramarren » Mon May 07, 2012 5:06 am

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.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 5 guests

cron