AutoLISP Function Syntax

AutoCAD AutoLISP & Visual LISP

 
AutoLISP Function Syntax
 
 
 

In this guide, the following conventions describe the syntax for AutoLISP functions:

In this example, the foo function has one required argument, string, and one optional argument, number. Additional number arguments can be provided. Frequently, the name of the argument indicates the expected data type. The examples in the following table show both valid and invalid calls to the foo function.

Valid and invalid function call examples

Valid calls

Invalid calls

(foo "catch")

(foo 44 13)

(foo "catch" 22)

(foo "fi" "foe" 44 13)

(foo "catch" 22 31)

(foo)