chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Documentation system?


From: Mario Domenech Goulart
Subject: [Chicken-users] Documentation system?
Date: Tue, 05 Jul 2005 00:02:14 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Hello

Is there some documentation system for chicken?  I mean something that
you can use from the interpreter.  I couldn't find any, so I made a
simple parser to the chicken.texi file which generates the documentation
in a way that can be easily used by an extension from the interpreter.

I've been using such a simple extension as a "chicken help".  It's been
useful for me, so I am sharing it with you.

Below you can see a "help session":

,----[ $ csi ]
|   _, _,_ _  _, _,_ __, _, _
|  / ` |_| | / ` |_/ |_  |\ |
|  \ , | | | \ , | \ |   | \|
|   ~  ~ ~ ~  ~  ~ ~ ~~~ ~  ~
| Version 1, Build 89 - linux-unix-gnu-unknown
| (c)2000-2004 Felix L. Winkelmann
| #;1> (use doc)
| ; loading ./doc.scm ...
| ; loading library srfi-13 ...
| ; loading library regex ...
| #;2> (doc:load "chicken.doc")     
| #;3> (doc:search "->string")
| byte-vector->string
| reverse-list->string
| keyword->string
| ->string
| seconds->string
| time->string
| #;4> (doc:help "keyword->string")
| keyword->string (keyword->string KEYWORD)
| 
| Transforms  `KEYWORD' into a string.
`----

A quick explanation about the functions:

(doc:load "doc-file"): loads "doc-file" into the documentation system
database.  The database is a hash-table mapping symbol names to the
corresponding prototypes and descriptions.

(doc:help "symbol"): displays information about "symbol" in the
following format:

    <symbol-name> <prototype>

    <description>

(doc:search "pattern"): searches for "pattern" (a regexp) in the
database's keys.

(doc:search-desc "pattern"): searches for "pattern" (a regexp) in the
database's description fields.


The "doc-file" I've been using was generated from the chicken.texi file
(the program chicken-doc.scm helped in this task -- generates
chicken.doc).  It's a list of items with the following format:

    ("symbol name" "prototype" "description")

I put the code at http://www.inf.ufrgs.br/~mario/misc/chicken-doc.tar.gz

If you know some other documentation system for chicken or if you have
suggestions about how to improve this one, let me know.


Best wishes,
Mario




reply via email to

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