guile-user
[Top][All Lists]
Advanced

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

Re: my emacs minor-mode for generating docstrings, v180902d


From: Arne Babenhauserheide
Subject: Re: my emacs minor-mode for generating docstrings, v180902d
Date: Mon, 03 Sep 2018 01:30:59 +0200
User-agent: mu4e 1.0; emacs 25.3.1

Matt Wette <address@hidden> writes:

> Now if I load my scheme-texidoc minor mode, place the point just before
> `(define (' and hit [(control c) (control d)], I end up with a docstring
> generated by running the comments through `texi2any --plaintext'.
>
> ;; @deffn {Procedure} prece a b po
> ;; Return precedence for arguments @var{a}, @var{b} given the partial
> ;; order @var{po}.  The result is of the form @code{'lt}, @code{'gt},
> ;; @code{'eq} or @address@hidden
> ;; Note: @var{po} may not a true partial order as we can have a<b and
> ;; b<a => a=b.  For example,
> ;; @example
> ;; @code{(prece a a po)} => @code{'eq}.
> ;; @end example
> ;; @end deffn
> (define (prece a b po)
>   "- Procedure: prece a b po
>      Return precedence for arguments A, B given the partial order PO.
>      The result is of the form ''lt', ''gt', ''eq' or '#f'.
>      Note: PO may not a true partial order as we can have a<b and b<a =>
>      a=b.  For example,
>           (prece a a po) => 'eq."
>   (cond
>    ((eqv? a b) 'eq)
>    ((eqv? a '$error) 'lt)
>    ((eqv? b '$error) 'gt)
>    ((<? a b po) (if (<? b a po) 'eq 'lt))
>    (else (if (<? b a po) 'gt #f))))
>
>
> and in Guile I get
>
> scheme@(guile-user)> ,d prece
> - Procedure: prece a b po
>      Return precedence for arguments A, B given the partial order PO.
>      The result is of the form ''lt', ''gt', ''eq' or '#f'.
>      Note: PO may not a true partial order as we can have a<b and b<a =>
>      a=b.  For example,
>           (prece a a po) => 'eq.

This looks pretty useful. I don’t write texinfo yet (though I should),
but if I did, getting rid of the repetition is great!

Best wishes,
Arne

Attachment: signature.asc
Description: PGP signature


reply via email to

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