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

I have one last thing to note about functions and variables. Remember that all functions return a value. For example, in the A1, A10, and A100 example function set, (PRINT A) returns a value to the console, printing the result of 1 twice at the command prompt. You can avoid the direct return to the command prompt in Visual LISP by adding a (PRIN1) or (PRINC) expression at the end of the function. Most of the examples in this book take advantage of the "silent exit" provided by (PRIN1) when a command function is involved.
Sometimes a function returns more than just a single result or returns a result that is difficult to express as a data list or single value. In these cases, you can program the function to change global values. This is what happened in Listing 3.6, where the A100 function changed the A symbol, which was global with respect to A100 but local with respect to the parent function, A10. When a function changes the value of a variable that is global with respect to the function, the function is said to have a side effect.
Side effects can be desirable. For example, suppose you have a function that handles all input from the operator and sets a series of variables from that input. The function then returns a true or false result indicating whether or not valid input was received.