Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Creating Your First Lisp Program > Defining Local Variables in Lisp

2.5. Defining Local Variables in Lisp

For our simple game, we’ve defined global variables and functions. However, in most cases you’ll want to limit your definitions to a single function or a block of code. These are called local variables and functions.

To define a local variable, use the command let. A let command has the following structure:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial