Author Topic: Isolate different routines to run without interference  (Read 486 times)

0 Members and 1 Guest are viewing this topic.


  • Mosquito
  • Posts: 5
Isolate different routines to run without interference
« on: March 31, 2023, 10:29:08 PM »

I've been writing lisp routines for the past 10 years, Most of the time using the similar functions/global variables names for different routines, recently I ran into a problem for some users when they try to use different routines at the same time they interfere with each other operation, Also routines are automatically loaded with autoload function with the path stored in the registry so asking the user to reload manually or close and re-open the file so often is quite inconvenient for them.

Now considering that each routine is a few thousands lines, What I'm locking for is a way to automatically rename all functions/variables to make them unique for each routine.


  • Swamp Rat
  • Posts: 1383
  • 40 + years of using Autocad
Re: Isolate different routines to run without interference
« Reply #1 on: April 01, 2023, 12:41:30 AM »
Ok 1st thing is make sure all defuns are locallised as much as possible eg (defun c:wow ( / x y) x and y are local.

Ok how to find, I use FINDSTR to look inside a lisp for a key word.

Go lower left in windows Type CMD this puts you in operating system mode, you need to know a little DOS now.

CD Bigal\mylisp programs so you need to change to the directory you want to check.

The type findstr defun *.lsp > defun.txt
A text file defun.txt should now exist showing file name and the line with defun in it. Thats about as far as can help as naming commands etc will be up to you.
A man who never made a mistake never made anything