I agree with SMadsen, in that that we are saying almost the same thing. But, I was refering to the fact that if you nest your defuns the sub procedure is still availble to you after the main procedure has finished. --For instance:
(defun main ()
(defun sub ()
(alert "Goodbye!"))
(alert "Hello there!")
(sub)
)
Go ahead and load that up and run 'main'. Now run 'sub'. The procedure isnt localised like a variable is localised. But this is just beating a dead horse...
One of the major reasons for creating 'block-structures' (a procedure with nested procedures) is for creating "true" 'black box' routines/solutions.
Ok im done.
Please note that you DID NOT declare them local. This is exactly what I said previously. If you do not declare them local it makes no difference. This is exactly how the autoload stub function creates the autoload lisp programs.
Well no one has mentioned compiling yet, so I guess I will. What about compiling with "separate namespace"?
If you compile to a seperate namespace none of the defuns are available EXCEPT those defun'd with C:
It makes absolutely no difference if you declare them local or not in compiled seperate namespace applications.
The location of the defuns are also unimportant (inside vs outside a wrapper function).