简体   繁体   English

Common Lisp的静态代码分析工具?

[英]Static code analysis tool for Common Lisp?

I'm busy learning Common Lisp, & I'm looking for a static code analysis tool that will help me develop better style & avoid falling into common traps. 我正忙着学习Common Lisp,我正在寻找一种静态代码分析工具,它可以帮助我开发出更好的风格并避免陷入常见的陷阱。

I've found Lisp Critic and I think it looks good, but I was hoping that someone may be able to recommend some other tools, and / or share their experiences with them. 我找到了Lisp Critic ,我觉得它看起来不错,但我希望有人可以推荐一些其他工具,和/或与他们分享经验。

Given the dynamic nature of Lisp, static analysis is everything from tough to impossible, depending on the type of source code. 鉴于Lisp的动态特性,静态分析是从艰难到不可能的一切,具体取决于源代码的类型。

For some purposes I would recommend using the SBCL compiler. 出于某些目的,我建议使用SBCL编译器。 Check out its manual for what features it provides. 查看其手册,了解它提供的功能。 One feature is some form of type inference. 一个特征是某种形式的类型推断。 It provides also a lot of standard warnings for things like undeclared variables, type problems, calling functions with the wrong number of args, using undefined functions, violating the ANSI CL standard in various ways and more. 它还为未声明的变量,类型问题,使用错误数量的args调用函数,使用未定义的函数,以各种方式违反ANSI CL标准等提供了许多标准警告。

The best way to learn about good style is to read a lot of code and ask for others to review your code. 了解好风格的最佳方法是阅读大量代码并要求其他人审核您的代码。 This isn't something that's specific to Common Lisp. 这不是Common Lisp特有的。

I think that one gray tool is use lisp-critic, you can get some information here: 我认为一个灰色工具是使用lisp-critic,你可以在这里获得一些信息:

http://quickdocs.org/lisp-critic/ http://quickdocs.org/lisp-critic/

and a remake that was done by @Xach 以及由@Xach完成的翻拍

http://xach.com/lisp/ http://xach.com/lisp/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM