In lisp, there's nothing wrong with using the func name as a local var.
deegeecees, the above statement is not exactly true in all instances. We'll get back to that.
I never knew you could use a function name as a way to store a variable.
You can't. Well, you can but then it won't be a function anymore (except if the variable is a SUBR, EXRXSUBR or USUBR, of course).
AutoLISP creates something called stack frames for each function call. A frame consists of the function call and the parameters such as arguments and local variables. While a frame exists, you can assign values to parameters but you can't alter the function call itself as it "owns" the frame.
For example, the function below will put a frame on the stack and assign values to the local variable:
(defun test (num / test)(setq test (1+ (setq test num))))
Try enter it in the VLIDE and set a breakpoint at the opening paren of the first SETQ. Run it with (test 1.0). When halted, try invoke View->Trace Stack. You'll see the frame (TEST 1.0) appear with a level number in square brackets. Right clicking on it will give you the option of inspecting the parameters. Notice that the local var TEST is nil (or a number depending if you stepped through the code) - it doesn't point to the function.
However, if we force AutoLISP to create yet another frame by calling the function recursively, we will have messed it up by using the function name as a local var:
(defun test (num / test) (setq test (test (1+ num))))
Set the breakpoint the same place, call it with the expression before and step through it until you get an error. Then open the Trace Stack again (or click the refresh button if it's already open). You will notice two frames on the stack:
[2](TEST 2.0)
[3](TEST 1.0)
While we couldn't alter the function call within a single frame, it is certainly possibly to alter it between frames. Because TEST calls itself and thereby needs a new frame on the stack, it will now see the value of the local variable with the same name as being the function address and say, "hey, that's not a valid address!".
So, there IS something wrong with using the function name as a local variable (shame on me) but, in the scope of a function call, the two are completely different entities.