z_axis
z_axis

Reputation: 8460

How can i implement "doc" function in clisp?

In clojure, i can use doc as below:

Clojure> (doc juxt)
-------------------------
clojure.core/juxt

([f] [f g] [f g h] [f g h & fs]) Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]enter code here

It seems there is no such a function in clisp ? Then how can i implement such a function ?

Sincerely!

Upvotes: 0

Views: 90

Answers (2)

z_axis
z_axis

Reputation: 8460

describe works:

(describe #'expt)
#<SYSTEM-FUNCTION EXPT> is a built-in system function.
Argument list: (#:ARG0 #:ARG1)
For more information, evaluate (DISASSEMBLE #'EXPT).nter code here

Upvotes: 2

Will Hartung
Will Hartung

Reputation: 118631

Lisp has Documentation Strings.

For example:

[1]> (defun sqr (x)
       "Returns the square of x"
       (* x x))
SQR
[2]> (documentation 'sqr 'function)
"Returns the square of x"
[3]> 

Refer to the Hyperspec or this less detailed explanation for more details.

Upvotes: 2

Related Questions