Functions for Program Structure
Defun
- Syntax ?(defun name (argument
.. / localvar localvar
.)
- Stores a series of commands in memory so they may be used over and over again
- Arguments
- After the definition name, a statement (one open parenthesis followed by one closed parenthesis) defines the arguments and the variables
- A forward slash divides the arguments with the local variables
- Arguments pass variables from the calling program to the subroutine, makes the subroutine more flexible
- If you pass a subroutine an argument, it does not have to have the same name in both routines, if fact, doing so may cause confusion when you try to understand the program