>From b7b9b2b37a2f5bb4928505fe271767f89c851d08 Mon Sep 17 00:00:00 2001 From: Bake Timmons Date: Wed, 11 Jan 2012 23:55:18 -0500 Subject: [PATCH] Improve the usage of variable names in Scheme docstrings. * module/ice-9/boot-9.scm: * module/ice-9/popen.scm: * module/ice-9/pretty-print.scm: * module/ice-9/r4rs.scm: * module/rnrs/io/ports.scm: * module/texinfo/string-utils.scm: * module/web/http.scm: * module/web/request.scm: * module/web/response.scm: * test-suite/vm/run-vm-tests.scm: Make the variable names in Scheme docstrings more consistent. Replace a few instances of @var with @code when appropriate. --- module/ice-9/boot-9.scm | 2 +- module/ice-9/popen.scm | 4 ++-- module/ice-9/pretty-print.scm | 2 +- module/ice-9/r4rs.scm | 10 +++++----- module/rnrs/io/ports.scm | 2 +- module/texinfo/string-utils.scm | 4 ++-- module/web/http.scm | 2 +- module/web/request.scm | 2 +- module/web/response.scm | 2 +- test-suite/vm/run-vm-tests.scm | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 1de5edf..e220db2 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -161,7 +161,7 @@ non-locally, that exit determines the continuation." (set! with-throw-handler (lambda (k thunk pre-unwind-handler) "Add @var{handler} to the dynamic context as a throw handler -for key @var{key}, then invoke @var{thunk}." +for key @var{k}, then invoke @var{thunk}." (if (not (or (symbol? k) (eqv? k #t))) (scm-error "with-throw-handler" 'wrong-type-arg "Wrong type argument in position ~a: ~a" diff --git a/module/ice-9/popen.scm b/module/ice-9/popen.scm index b3def4a..b9debd4 100644 --- a/module/ice-9/popen.scm +++ b/module/ice-9/popen.scm @@ -136,7 +136,7 @@ "Executes the program @var{command} with optional arguments @var{args} (all strings) in a subprocess. A port to the process (based on pipes) is created and returned. address@hidden specifies whether an input, an output or an input-output address@hidden specifies whether an input, an output or an input-output port to the process is created: it should be the value of @code{OPEN_READ}, @code{OPEN_WRITE} or @code{OPEN_BOTH}." (let* ((port/pid (apply open-process mode command args)) @@ -148,7 +148,7 @@ port to the process is created: it should be the value of (define (open-pipe command mode) "Executes the shell command @var{command} (a string) in a subprocess. A port to the process (based on pipes) is created and returned. address@hidden specifies whether an input, an output or an input-output address@hidden specifies whether an input, an output or an input-output port to the process is created: it should be the value of @code{OPEN_READ}, @code{OPEN_WRITE} or @code{OPEN_BOTH}." (open-pipe* mode "/bin/sh" "-c" command)) diff --git a/module/ice-9/pretty-print.scm b/module/ice-9/pretty-print.scm index 5ea66c7..8a0c0b8 100644 --- a/module/ice-9/pretty-print.scm +++ b/module/ice-9/pretty-print.scm @@ -298,7 +298,7 @@ port directly after OBJ, like (pretty-print OBJ PORT)." (width 79) (display? #f) (breadth-first? #f)) - "Print @var{obj}, truncating the output, if necessary, to make it fit + "Print @var{x}, truncating the output, if necessary, to make it fit into @var{width} characters. By default, @var{x} will be printed using @code{write}, though that behavior can be overriden via the @var{display?} keyword argument. diff --git a/module/ice-9/r4rs.scm b/module/ice-9/r4rs.scm index 86b6e94..072c8c6 100644 --- a/module/ice-9/r4rs.scm +++ b/module/ice-9/r4rs.scm @@ -39,14 +39,14 @@ (@call-with-values producer consumer)) (define (dynamic-wind in thunk out) "All three arguments must be 0-argument procedures. address@hidden is called, then @var{thunk}, then address@hidden +Guard @var{in} is called, then @var{thunk}, then +guard @var{out}. If, any time during the execution of @var{thunk}, the continuation of the @code{dynamic_wind} expression is escaped -non-locally, @var{out_guard} is called. If the continuation of -the dynamic-wind is re-entered, @var{in_guard} is called. Thus address@hidden and @var{out_guard} may be called any number of +non-locally, @var{out} is called. If the continuation of +the dynamic-wind is re-entered, @var{in} is called. Thus address@hidden and @var{out} may be called any number of times. @lisp (define x 'normal-binding) diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm index 246e46b..fddb491 100644 --- a/module/rnrs/io/ports.scm +++ b/module/rnrs/io/ports.scm @@ -237,7 +237,7 @@ if the port has no transcoder." (not (port-encoding port))) (define (textual-port? port) - "Always returns @var{#t}, as all ports can be used for textual I/O in + "Always returns @code{#t}, as all ports can be used for textual I/O in Guile." #t) diff --git a/module/texinfo/string-utils.scm b/module/texinfo/string-utils.scm index eff9143..7675149 100644 --- a/module/texinfo/string-utils.scm +++ b/module/texinfo/string-utils.scm @@ -160,7 +160,7 @@ characters. Any needed padding is done by character @var{chr}, which defaults to @samp{#\\space}. If @var{rchr} is provided, then the padding to the right will use it instead. See the examples below. left and @var{rchr} on the right. The default @var{width} is 80. The -default @var{lchr} and @var{rchr} is @samp{#\\space}. The string is +default @var{chr} and @var{rchr} is @samp{#\\space}. The string is never truncated. @lisp (center-string \"Richard Todd\" 24) @@ -392,7 +392,7 @@ in @code{make-text-wrapper}." (define (fill-string str . kwargs) "Wraps the text given in string @var{str} according to the parameters -provided in @var{keywds}, or the default setting if they are not +provided in @var{kwargs}, or the default setting if they are not given. Returns a single string with the wrapped text. Valid keyword arguments are discussed in @code{make-text-wrapper}." (string-join (apply string->wrapped-lines str kwargs) diff --git a/module/web/http.scm b/module/web/http.scm index b060af9..c15bc3e 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -205,7 +205,7 @@ header with name @var{sym}." (define (write-header sym val port) "Writes the given header name and value to @var{port}. If @var{sym} is a known header, uses the specific writer registered for that header. -Otherwise the value is written using @var{display}." +Otherwise the value is written using @code{display}." (display (header->string sym) port) (display ": " port) ((header-writer sym) val port) diff --git a/module/web/request.scm b/module/web/request.scm index c9204a4..8259887 100644 --- a/module/web/request.scm +++ b/module/web/request.scm @@ -217,7 +217,7 @@ on @var{port}, perhaps using some transfer encoding." (bytevector-length bv) nbytes)))))) (define (write-request-body r bv) - "Write @var{body}, a bytevector, to the port corresponding to the HTTP + "Write @var{bv}, a bytevector, to the port corresponding to the HTTP request @var{r}." (put-bytevector (request-port r) bv)) diff --git a/module/web/response.scm b/module/web/response.scm index 6283772..f49a602 100644 --- a/module/web/response.scm +++ b/module/web/response.scm @@ -226,7 +226,7 @@ on @var{port}, perhaps using some transfer encoding." (bytevector-length bv) nbytes)))))) (define (write-response-body r bv) - "Write @var{body}, a bytevector, to the port corresponding to the HTTP + "Write @var{bv}, a bytevector, to the port corresponding to the HTTP response @var{r}." (put-bytevector (response-port r) bv)) diff --git a/test-suite/vm/run-vm-tests.scm b/test-suite/vm/run-vm-tests.scm index f23dff6..9304e81 100644 --- a/test-suite/vm/run-vm-tests.scm +++ b/test-suite/vm/run-vm-tests.scm @@ -67,7 +67,7 @@ it succeeded." (define (run-vm-tests files) "For each file listed in @var{files}, load it and run it through both the interpreter and the VM (after having it compiled). Both results must be -equal in the sense of @var{equal?}." +equal in the sense of @code{equal?}." (let* ((res (map (lambda (file) (format #t "running `~a'... " file) (if (catch #t -- 1.7.8.3