Matt Wette <matt.we...@gmail.com> 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 @code{#f}.@* > ;; 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
signature.asc
Description: PGP signature