Alternatively you could define separate scopes -
For instance you have defined these functions:
(defun C:test ( / )
(alert (strcat (alerting) ", guys"))
(princ)
)
(defun alerting nil
"Hello"
)
(defun C:test ( / )
(alert (strcat (alerting) ", there"))
(princ)
)
(defun alerting nil
"Hi"
)
You can wrap them in defuns with different names, but localise all the functions and subfunctions within:
(defun C:test1 ( / C:test alerting )
(defun C:test ( / )
(alert (strcat (alerting) ", guys"))
(princ)
)
(defun alerting nil
"Hello"
)
(C:test)
(princ)
)
(defun C:test2 ( / C:test alerting )
(defun C:test ( / )
(alert (strcat (alerting) ", there"))
(princ)
)
(defun alerting nil
"Hi"
)
(C:test)
(princ)
)
Thats one of the reasons I keep my smaller subs localised, since they are generic and I might have been used similar in other .lsp file - like this one:
(setq fill_listbox (lambda (k L) (start_list k) (mapcar 'add_list L) (end_list)))
And other subfunctions of mine that are 200+ rows and almost no risk of me to overwrite them, as global - such as "MergePDFs" or "AddMyLayers".