On Wed, Jul 8, 2015 at 10:17 AM, Robert Goldman rpgoldman@sift.net wrote:
Also I define asdf::e and asdf::ep symbol macros that access special variables.
When compilation fails, I have an EDIT-COMPONENT restart, which is not needed - it is just a help string. Then user should eval asdf::e in the debugger to edit component source. User should eval asdf::ep in the debugger to edit component's system source.
Code is here, it shoud work in asdf-3.1.4 under lispworks 6 or under SBCL+SLIME.
https://bitbucket.org/budden/budden-tools/src/866bcf15ad5c793868a0a31e602474...
I'd like to receive any feedback.
That code is not very readable in its present form. The content of the file is obscured by lots of lines of dead code. How about you clean it up a bit, and comment it a little before soliciting feedback again?
Also, you might want to split this into modifications/extensions to ASDF and code that interfaces to the Lispworks IDE. For questions about the latter, lispworks-hug is probably a more appropriate source of information.
The code is overall bad qualify and should be rewritten.
* It has a lot of dead code that should just be removed (if you ever need it again, the version control remembers; have a descriptive message of any interesting bits in your version log).
* It was obviously written for ASDF 1, and tries to do that ASDF 3 does better: see component-find-path, find-component, component-system, load-system, safe-read-from-string and/or eval-input, component-pathname, system-source-file.
* It is very poor taste to use special variables and redefine functions to access the current component. As Robert points out, the correct thing to do is unwrap the component from the error condition that is being handled. This is not C, this is Lisp! (insert this is Sparta meme). Instead of modifying a function to add a restart that doesn't even do the editing for you when it could, why don't you define a handler that adds a restart and re-signals? If somehow this is not possible, it might make sense to add a restart to ASDF itself, which would actually call the editor instead of hint at it, and where the editor, not the component, is the special variable that the user can thereby customize.
* Do NOT use keywordize and string-equal, use coerce-name and string=. You're introducing subtle incompatibility in your semantics.
* run-shell-command is deprecated, it's a braindead API copy-pasted from mk-defsystem. I have gone through excruciating efforts to offer you uiop:run-program that has a decent API and actually works portably. run-shell-command will be actively deprecated starting with ASDF 3.2: first mentioning it will be a style-warning nagware, then a full warning, then a cerror, then it will be gone.
* You don't need dependable-file, there's already static-file
* I don't see why ASDF needs a special recognition for a package-file; there is no way whatsoever that this is useful, and not every system is organized this way, anyway. By contrast, see package-inferred-system.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org A common man marvels at uncommon things; a wise man marvels at the commonplace. — Confucius
l of code for ASDF 1 that is obsolete for ASDF 3, and defines many variants of functions that ASDF 3 already has, such as component-find-path, while using special variables to subvert the system instead of using it.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org