Re: Reporting unused local variables

2009-07-30 Thread Ludovic Courtès
Hello! I just committed the changes summarized below that add `-W unused-variable' to "guile-tools compile". It appears to work well, but only has approximate source location info for `define-macro' expansions, for instance (but that's another story). Daniel: could you try it with the Elisp fron

Re: Reporting unused local variables

2009-07-28 Thread Ludovic Courtès
Hello Guilers! Here's a third attempt. This time, it's done as a separate pass at the tree-il level *and* in a purely functional way. I owe a great debt to a famous Scheme hacker whose paper /Applications of fold to XML transformation/ was a invaluable source of inspiration [0]. Thanks! :-) I

Re: Reporting unused local variables

2009-07-23 Thread Andy Wingo
On Thu 23 Jul 2009 23:21, l...@gnu.org (Ludovic Courtès) writes: > ¡Hola! > > Andy Wingo writes: > >> OK, here's another idea. Why don't we keep this as a separate pass -- >> enabled if you pass a compilation option. That way it can be more >> functional, and you can keep approximate source infor

Re: Reporting unused local variables

2009-07-23 Thread Ludovic Courtès
¡Hola! Andy Wingo writes: > OK, here's another idea. Why don't we keep this as a separate pass -- > enabled if you pass a compilation option. That way it can be more > functional, and you can keep approximate source information. By "pass", you mean a new "language" in the tower? As in `lookup-

Re: Reporting unused local variables

2009-07-23 Thread Andy Wingo
Hi Ludovic, This isn't a review really, because I changed the code in question... I hope you find the new analyze-lexicals procedure easier to understand. It's certainly better documented :) On Thu 02 Jul 2009 19:35, l...@gnu.org (Ludovic Courtès) writes: > l...@gnu.org (Ludovic Courtès) writes:

Re: Reporting unused local variables

2009-07-02 Thread Ludovic Courtès
Hello, l...@gnu.org (Ludovic Courtès) writes: > The attached patch is an attempt to add unused variable reporting to the > compiler, at the GLIL->assembly step. It was quite simple to implement > here, and it should work with all front-ends (Scheme, ECMAScript, etc.), > which is nice. Following

Re: Reporting unused local variables

2009-06-29 Thread Neil Jerram
l...@gnu.org (Ludovic Courtès) writes: > Is this the right place and the right way to do such things? Comments? Looks great to me - but I'm still a bit of a newbie at this compiler malarkey. Neil

Reporting unused local variables

2009-06-28 Thread Ludovic Courtès
Hello, The attached patch is an attempt to add unused variable reporting to the compiler, at the GLIL->assembly step. It was quite simple to implement here, and it should work with all front-ends (Scheme, ECMAScript, etc.), which is nice. Example: --8<---cut here---start