summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNo Itisnt <theseaisinhere+git@gmail.com>2010-05-25 15:53:24 -0500
committerNo Itisnt <theseaisinhere+git@gmail.com>2010-05-25 15:54:05 -0500
commit6942d86409130df766f6ce16a15c0de7b207db61 (patch)
tree635674a985994dd18f46224fd09ca1c4706ab5f2
parente525e4e4995ea9115bd91e0fd6ce25b1bcdb6790 (diff)
downloadguile-6942d86409130df766f6ce16a15c0de7b207db61.tar.gz
* doc/ref/srfi-modules.texi:
* module/srfi/srfi-9/gnu.scm: rename `define-record-printer' to `set-record-printer!' to reflect the fact that the printer is set at runtime
-rw-r--r--doc/ref/srfi-modules.texi6
-rw-r--r--module/srfi/srfi-9/gnu.scm8
2 files changed, 6 insertions, 8 deletions
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 34009968d..b3f99460b 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -1930,11 +1930,11 @@ desired, exported from a module, etc.
@subsubsection Custom printers
@cindex record printer
-You may use @code{define-record-printer} to customize the default printing
+You may use @code{set-record-printer!} to customize the default printing
behavior of records. This is a GUILE extension and is not part of SRFI-9. It is
located in the @nicode{(srfi srfi-9 gnu)} module.
-@deffn {library syntax} define-record-printer name thunk
+@deffn {library syntax} set-record-printer! name thunk
Where @var{type} corresponds to the first argument of @code{define-record-type},
and @var{thunk} is a procedure accepting two arguments, the record to print, and
an output port.
@@ -1945,7 +1945,7 @@ an output port.
This example prints the employee's name in brackets, for instance ``@code{[Fred]}''.
@example
-(define-record-printer employee-type
+(set-record-printer! employee-type
(lambda (record port)
(write-char #\[ port)
(display (get-employee-name record) port)
diff --git a/module/srfi/srfi-9/gnu.scm b/module/srfi/srfi-9/gnu.scm
index e4919226c..3a37471b1 100644
--- a/module/srfi/srfi-9/gnu.scm
+++ b/module/srfi/srfi-9/gnu.scm
@@ -23,9 +23,7 @@
;;; Code:
(define-module (srfi srfi-9 gnu)
- #:export (define-record-printer))
+ #:export (set-record-printer!))
-(define-syntax define-record-printer
- (syntax-rules ()
- ((_ type thunk)
- (struct-set! type vtable-index-printer thunk))))
+(define (set-record-printer! type thunk)
+ (struct-set! type vtable-index-printer thunk))