guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-10-193-g4


From: No Itisnt
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-10-193-g40b19fd
Date: Wed, 26 May 2010 21:04:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=40b19fda5c92e5acbb13351ebbe8c70c3337c82d

The branch, master has been updated
       via  40b19fda5c92e5acbb13351ebbe8c70c3337c82d (commit)
       via  6942d86409130df766f6ce16a15c0de7b207db61 (commit)
       via  e525e4e4995ea9115bd91e0fd6ce25b1bcdb6790 (commit)
      from  400a5dcb8b3bb042d8106f0aca69aecc6fd0628c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 doc/ref/srfi-modules.texi                  |   29 ++++++++++++++++++++++++++++
 module/srfi/{srfi-8.scm => srfi-9/gnu.scm} |   16 ++++++--------
 2 files changed, 36 insertions(+), 9 deletions(-)
 copy module/srfi/{srfi-8.scm => srfi-9/gnu.scm} (70%)

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 0d192fa..b3f9946 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -1922,6 +1922,35 @@ The functions created by @code{define-record-type} are 
ordinary
 top-level @code{define}s.  They can be redefined or @code{set!} as
 desired, exported from a module, etc.
 
address@hidden
+* SRFI-9 Custom printers::      Customizing print behavior.
address@hidden menu
+
address@hidden SRFI-9 Custom printers
address@hidden Custom printers
address@hidden record printer
+
+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.
+
address@hidden {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.
+
address@hidden deffn
+
address@hidden
+This example prints the employee's name in brackets, for instance 
address@hidden''.
+
address@hidden
+(set-record-printer! employee-type
+  (lambda (record port)
+    (write-char #\[ port)
+    (display (get-employee-name record) port)
+    (write-char #\] port)))
address@hidden example
 
 @node SRFI-10
 @subsection SRFI-10 - Hash-Comma Reader Extension
diff --git a/module/srfi/srfi-8.scm b/module/srfi/srfi-9/gnu.scm
similarity index 70%
copy from module/srfi/srfi-8.scm
copy to module/srfi/srfi-9/gnu.scm
index ced1238..3a37471 100644
--- a/module/srfi/srfi-8.scm
+++ b/module/srfi/srfi-9/gnu.scm
@@ -1,6 +1,6 @@
-;;; srfi-8.scm --- receive
+;;; Extensions to SRFI-9
 
-;; Copyright (C) 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
+;;     Copyright (C) 2010 Free Software Foundation, Inc.
 ;;
 ;; This library is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU Lesser General Public
@@ -18,14 +18,12 @@
 
 ;;; Commentary:
 
-;; This module is fully documented in the Guile Reference Manual.
+;; Extensions to SRFI-9. Fully documented in the Guile Reference Manual.
 
 ;;; Code:
 
-(define-module (srfi srfi-8)
-  :use-module (ice-9 receive)
-  :re-export-syntax (receive))
+(define-module (srfi srfi-9 gnu)
+  #:export (set-record-printer!))
 
-(cond-expand-provide (current-module) '(srfi-8))
-
-;;; srfi-8.scm ends here
+(define (set-record-printer! type thunk)
+  (struct-set! type vtable-index-printer thunk))


hooks/post-receive
-- 
GNU Guile



reply via email to

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