un-declare symbols check tool for newLISP

Started by ssqq, January 13, 2015, 04:24:37 AM

Previous topic - Next topic

ssqq

I write a tool for checking un-declare symbol of newLISP code, it need improve more.



https://github.com/songzan/Spp/blob/master/strict.lsp">https://github.com/songzan/Spp/blob/master/strict.lsp



If you want test it, pls link it first (or change default *main-args* number):



On Winxp:



       > newlisp -x strict.lsp strict.exe

       > strict your-script.lsp



On Linux:



      > newlisp -x strict.lsp strict

      > chmod 755 strict

      > ./strict your-script.lsp



1. all un-declare symbol would output an warning.

2. all un-used symbol declared with *local*, *let*, *letn*, *letex* would output an warning.

3. all symbol declared with *set* or *setq* in *lexical scope* would throw an warning.



todo:



1. could not check the symbols *import* from C module

2. could not check *other* context symbols.

3. could not check symbol created with *new* or *bind*.

4. warning message have not the line number and pos message.



welcome give me some suggest.

TedWalther

#1
Very nice.  Any further development on it?  I really could have used this last summer, but my brain overlooked your post.  Sorry.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.