unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#41126: [PATCH] doc: Added very minimal doc strings to (srfi srfi-9 gnu).
@ 2020-05-07 11:54 Dale Mellor
  2020-05-27 20:21 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Dale Mellor @ 2020-05-07 11:54 UTC (permalink / raw)
  To: 41126


* module/srfi/srfi-9/gnu.scm: Added some doc strings.
---
 module/srfi/srfi-9/gnu.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/module/srfi/srfi-9/gnu.scm b/module/srfi/srfi-9/gnu.scm
index 219bcdebb..0b9024e75 100644
--- a/module/srfi/srfi-9/gnu.scm
+++ b/module/srfi/srfi-9/gnu.scm
@@ -31,19 +31,25 @@
             set-fields))
 
 (define (set-record-type-printer! type proc)
-  "Set PROC as the custom printer for TYPE."
+  "- Scheme Procedure: set-record-type-printer! TYPE PROC
+     Set PROC as the custom printer for TYPE."
   (struct-set! type vtable-index-printer proc))
 
 (define-syntax-rule (define-immutable-record-type name ctor pred fields ...)
+  "- Scheme Procedure: define-immutable-record-type NAME CTOR PRED (FIELD GETTER [SETTER]) ..."
   ((@@ (srfi srfi-9) %define-record-type)
    #t (define-immutable-record-type name ctor pred fields ...)
    name ctor pred fields ...))
 
 (define-syntax-rule (set-field s (getter ...) expr)
+  "- Scheme Procedure: set-field RECORD (GETTER ...) EXPR
+      Set the field in RECORD with the GETTER, to the value of EXPR."
   (%set-fields #t (set-field s (getter ...) expr) ()
                s ((getter ...) expr)))
 
 (define-syntax-rule (set-fields s . rest)
+  "- Scheme Procedure: set-fields RECORD ((GETTER ...) EXPR) ...
+     Set the fields in the RECORD with the given GETTERs to the corresponding EXPRessions."
   (%set-fields #t (set-fields s . rest) ()
                s . rest))
 
-- 
2.20.1







^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#41126: [PATCH] doc: Added very minimal doc strings to (srfi srfi-9 gnu).
  2020-05-07 11:54 bug#41126: [PATCH] doc: Added very minimal doc strings to (srfi srfi-9 gnu) Dale Mellor
@ 2020-05-27 20:21 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2020-05-27 20:21 UTC (permalink / raw)
  To: Dale Mellor; +Cc: 41126

Hi Dale,

Dale Mellor <guile-qf1qmg@rdmp.org> skribis:

> * module/srfi/srfi-9/gnu.scm: Added some doc strings.

[...]

>  (define (set-record-type-printer! type proc)
> -  "Set PROC as the custom printer for TYPE."
> +  "- Scheme Procedure: set-record-type-printer! TYPE PROC
> +     Set PROC as the custom printer for TYPE."

The convention in Guile is to write docstrings like it was initially
written.  The bit you added is redundant with the function prototype,
which tools like Geiser automatically print for yourself.

At the “raw” REPL, you can also view that info:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,a set-record-type-printer!
(srfi srfi-9 gnu): set-record-type-printer!	#<procedure set-record-type-printer! (type proc)>
scheme@(guile-user)> ,d set-record-type-printer!
Set PROC as the custom printer for TYPE.
scheme@(guile-user)> set-record-type-printer!
$9 = #<procedure set-record-type-printer! (type proc)>
--8<---------------cut here---------------end--------------->8---

If you wish, you can submit an updated patch that follows these
conventions.

Thank you,
Ludo’.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-27 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:54 bug#41126: [PATCH] doc: Added very minimal doc strings to (srfi srfi-9 gnu) Dale Mellor
2020-05-27 20:21 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).