Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hunting for globals that shouldn't be

3 REPLIES 3
Reply
Message 1 of 4
TheDarkPrincess
356 Views, 3 Replies

hunting for globals that shouldn't be

I can run atoms-family and get a list of all symbols, and I have a lisp which searchs through all my lisp files to find something.  but I'm wondering if anyone has built a parser that skips through a function and finds all the variables and determines if any are global?   Does vlide do something like this?

 

TDP

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: TheDarkPrincess

if you use the check edit window button in the vlide it will list all the functions and their global variables in the build output window

 

eg

 

function is LOAD_LT -> global vars are FNAME and PATH

 

; === Top statistic:
; Global variables: (FNAME PATH)
; Function definition (with number of arguments): ((LOAD_LT . 0))
; Check done.

Message 3 of 4
stevor
in reply to: TheDarkPrincess

1. The Vlide may do what you want, or so  implied here:

 

http://rkmcswain.blogspot.com/2006/07/vlisp-variables.html

 

only if the "Report statistics during syntax checking" box is checked.

 

2. In our small group, we use the '*' within a global variable to make them more findable.

 

And even with that convention, our  parser to find local variables within the text of a DEFUN  was  massive, and undependable.

 

And the inadvertent global is the worst: making values change improperly because they were reset somewhere else.

 

Now we belong to the school of minimum globals.

 

 .

S
Message 4 of 4
TheDarkPrincess
in reply to: stevor

thanks for the reply.  I use very few globals - and most of mine store data in an assoc list.   I've found a few functions that are rather large where I've missed setting a couple of variables to local....and with 90,000+ loines of code well I want to make a good check.  such a parser must be very elegantly written or it becomes unwieldy and bugggy....

 

thanks for your help on the vlide thing...

 

Jamie

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost