From the course: Learning AutoLISP & Visual LISP

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Creating a defined function

Creating a defined function - AutoCAD Tutorial

From the course: Learning AutoLISP & Visual LISP

Creating a defined function

- [Instructor] When it comes to programming, a named section of a program that performs a specific task is called a function. What is more, LISP is a functional programming language. So we're going to talk a lot throughout this course about functions. LISP contains many built-in functions that we're going to learn about, and we're also going to create our own named sections of programming that will perform specific tasks. So when we create a defined function within LISP, the function will always return a value. If we haven't specified the value, the key is that it will simply return the end result of the last line in the function for that list that creates the function. Of course, to create a function of our own, our LISP file, we have to use a LISP function. You see how often we're going to be talking about functions. I'm going to create a new LISP file, and inside the LISP file, I'm going to create or define our own function. We use the LISP routine or LISP function named DEFUN…

Contents