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

I. Lisp is Power > 3. Exploring the Syntax of Lisp Code

Chapter 3. Exploring the Syntax of Lisp Code

As you’ve learned so far, Lisp commands must be entered in a rather unorthodox way, with parentheses surrounding each command. In this chapter, we’ll explore why Lisp works this way.

To understand why any language—whether it’s a programming language or a human language—looks a certain way, we need to begin with two concepts from the field of linguistics: syntax and semantics.

Syntax and Semantics

Here is a typical sentence in the English language:

My dog ate my homework.

This sentence has the correct syntax for a sentence in English. The syntax of a piece of text represents the basic rules that it needs to follow to be a valid sentence. Here are some of the rules of sentences in the English language that this text obeys:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint