The AutoCADET's Guide to Visual LISP: Optimize and Customize Your AutoCAD Design Environment

Atoms and Lists

Before you go too much deeper into LISP subrs and functions, you need to understand the types of data you may be manipulating. LISP data is either an atom or a list. Making this definition even simpler is the notion that an atom is anything that does not have parentheses, except the NIL symbol or value. NIL is an empty list and is usually not shown with parentheses. NIL is the atomic value nothing, or empty. You use NIL also to represent the value false when working with true-false logic in a LISP program. Anything that is not NIL is true.

Visual LISP contains several atomic data types, such as number and text atoms. You perform arithmetic-type operations on numbers, but not with text. The atomic types help keep your variables in order. Plus, you can test the types during program execution, giving you tremendous control over the environment your program runs in.

Table 3.1 describes the specific atomic types in Visual LISP. Because Visual LISP is intended for use in the AutoCAD environment, some elements are specific to AutoCAD and do not exist in other LISP environments.

Table 3.1: Data types.

Data type

Description

INT

Integer. A whole number ranging from -2,147,483,648 to 2,147,483,647. Integers are useful in counting and in controlling loops. An integer cannot contain a decimal point.

REAL

Real; also known as a double-precision real number. A number with a decimal point. Real numbers can be quite large or...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Communications Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.