This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pretty-print


   From: Keisuke Nishida <kxn30@po.cwru.edu>
   Date: 20 Sep 2000 13:31:33 -0400

   Does anyone have a Scheme version of pretty-print?  That is,
   something like

     > (pprint '(foo-foo-foo (bar-bar-bar (baz-baz-baz))))
     (foo-foo-foo
       (bar-bar-bar
	 (baz-baz-baz)))

slib has pretty-print.scm, and a format.scm that requires it.  because
guile module (ice-9 format) is an adaptation of slib's format.scm, the
`require' form is still present.  this means that you can try to use
(ice-9 format) but will probably get an error unless slib is already
loaded in the session.  looks like the (ice-9 format) i have is still
buggy -- see session log below -- it's module definition needs to be
changed to:

(define-module (ice-9 format)
  :use-module (ice-9 slib))

thi


_________________________________
guile> (use-modules (ice-9 slib))
guile> (use-modules (ice-9 format))
guile> (define a '(foo-foo-foo (bar-bar-bar (baz-baz-baz))))
guile> (format #t "~Y" a)
/usr/local/share/guile/1.4.1/ice-9/format.scm:448:16: In expression (require (quote pretty-print)):
/usr/local/share/guile/1.4.1/ice-9/format.scm:448:16: Unbound variable: require
ABORT: (unbound-variable)
guile> (define-module (ice-9 format) :use-module (ice-9 slib))
#<directory (ice-9 format) 40219fb0>
guile> (define-module (guile-user))
#<directory (guile-user) 4020ecd8>
guile> (format #t "~Y" a)
(foo-foo-foo (bar-bar-bar (baz-baz-baz)))
#t
guile> 
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]