guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Docstrings


From: Keisuke Nishida
Subject: Re: Docstrings
Date: Mon, 09 Apr 2001 04:05:44 -0400
User-agent: Wanderlust/2.4.0 (Rio) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/21.0.102 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

At 08 Apr 2001 22:52:53 -0400,
Ariel Rios wrote:
> 
> I do not know much about docstrings but I want to do the following:
> (help socket) displays the information rather than returning a string.
> I want to be able to do so because I have built a function called
> (repl-help func) that intends to show the info about that function
> as html inside  GtkHTML, Is this possible w/out having to modify help
> from session.scm?

(help socket) already displays the information.
Do you want a string instead?  If so, `object-documentation'
in (ice-9 documentation) is for you:

guile> (use-modules (ice-9 documentation))
guile> (object-documentation socket)
$1 = " - primitive: socket family style proto
     Return a new socket port of the type specified by FAMILY, STYLE
     and PROTOCOL.  All three parameters are integers.  Typical values
     for FAMILY are the values of `AF_UNIX' and `AF_INET'.  Typical
     values for STYLE are the values of `SOCK_STREAM', `SOCK_DGRAM' and
     `SOCK_RAW'.  PROTOCOL can be obtained from a protocol name using
     `getprotobyname'.  A value of zero specifies the default protocol,
     which is usually right.  A single socket port cannot by used for
     communication until it has been connected to another socket."

(BTW, (with-output-to-string (lambda () (help socket))) doesn't work. Why?)

Keisuke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]