[lgtk-devel] [PATCH] A fistful of docstrings (Was: Re: [...] A few more button functions)

Sverker Wiberg sverkerw at swipnet.se
Wed Mar 3 01:44:49 UTC 2004


On Tue, 2004-03-02 at 01:54, Sverker Wiberg wrote:
> On Mon, 2004-03-01 at 18:43, Mario S.Mommer wrote:
[...]
> > Sverker Wiberg <sverkerw at swipnet.se> writes:
[...]
> > > Right now I'm thinking on adding docstring support to def-binding and
> > > friends. Any thoughts?
> > 
> > It would not hurt, I guess.

Here's a patch that adds docstring support to DEF-BINDING! (And
docstrings to a few other defs.)

>  Where do you propose to put the docstrings?
> 
> In the syntax? In the usual place, after the name (&optional of course)[...]

Thinking things over I realized (or decided) that the type list is
analogous to the lambda list of a defun. So I placed the docstring
between the type list and the keywords (pretend that the keywords make
up the body). A current example with all bells and whistles would be:

   (def-binding "some_function"
      (guint (c-string name) (voidptr data))
      "Does some stuff..."
      :before (incf *my-statistics*)
      :after (lambda (x) (format t "Got ~s~%" x) x))

/Sverker

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc-strings-1.diff
Type: text/x-patch
Size: 6416 bytes
Desc: 
URL: <https://mailman.common-lisp.net/pipermail/lgtk-devel/attachments/20040303/f8b43336/attachment.bin>


More information about the lgtk-devel mailing list