开发者

Predicates Common Lisp

Do you know where can I get the source of a predicate in Common Lisp? (The content of the predicate, if you pre开发者_如何学运维fer.) For example, source code of setq, string= etc.

Thanks !


Common Lisp development environments typically provide a way to look up definitions in the file with the source code.

Alternatively, FUNCTION-LAMBDA-EXPRESSION might be able to recover the source of a predicate and other functions, if the Lisp environment has been configured to save the definitions.

You can also search in the lisp files of open source lisp implementations. For example, in Clozure CL setq is defined in the compiler/nx1.lisp file of the distribution. A tip is to place a space in the front of the search word to bypass matches like (setq.


For at least SBCL, SLIME can look up the definitions by pressing "M-.", however you need to have compiled SBCL from source for this to work, as the path to the source definitions are embedded in the binary, and if you use a binary distribution you are probably not going to have the source files in the same location.


SETQ is not a predicate. It is not even a function, which is why you couldn't find it through the IDE. STRING= is a predicate and a function, so works better.

Do you mean "primitive?" for "predicate"?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜