Skip to Content
Land of Lisp
book

Land of Lisp

by Conrad Barski M.D.
November 2010
Intermediate to advanced
504 pages
12h 45m
English
No Starch Press
Content preview from Land of Lisp

How Lisp Distinguishes Between Code and Data

When we write our Lisp program, how does Lisp decide which parts of our program consist of code (stuff to be executed) and which parts are just data? The syntax of Lisp has a special way of distinguishing between the two.

Common Lisp uses two modes when it reads your code: a code mode and a data mode. You can switch between these two modes when writing Lisp code.

Code Mode

Whenever you type something into the Lisp REPL, the compiler assumes that you’re entering a command you want to execute. In other words, Lisp always assumes that you’re writing code and defaults to code mode.

As we’ve already discussed, Lisp will expect Lisp code to be entered as a list. However, the code should be in a special type of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Common Lisp

Practical Common Lisp

Peter Seibel
The Rust Programming Language, 2nd Edition

The Rust Programming Language, 2nd Edition

Steve Klabnik, Carol Nichols
Programming Rust, 2nd Edition

Programming Rust, 2nd Edition

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall
The Go Programming Language

The Go Programming Language

Alan A. A. Donovan, Brian W. Kernighan

Publisher Resources

ISBN: 9781593272814Errata Page