Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 prefer.) For example, source code of setq, string= etc.

Thanks !

like image 383
lilawood Avatar asked May 08 '11 20:05

lilawood


2 Answers

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.

like image 184
Terje Norderhaug Avatar answered Sep 17 '22 23:09

Terje Norderhaug


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.

like image 30
Elias Mårtenson Avatar answered Sep 18 '22 23:09

Elias Mårtenson