~ chicken-core (chicken-5) c4400ff01dad3ee02978642def1e7716c86388c5


commit c4400ff01dad3ee02978642def1e7716c86388c5
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Mon Jan 18 21:45:28 2016 +1300
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Tue Mar 8 22:52:33 2016 +1300

    Move pretty-print procedures to new chicken.pretty-print module

diff --git a/README b/README
index 0e70302d..b34982bd 100644
--- a/README
+++ b/README
@@ -300,6 +300,7 @@
 	|   |       |-- chicken.irregex.import.so
 	|   |       |-- chicken.ports.import.so
 	|   |       |-- chicken.posix.import.so
+	|   |       |-- chicken.pretty-print.import.so
 	|   |       |-- chicken.random.import.so
 	|   |       |-- chicken.repl.import.so
 	|   |       |-- chicken.tcp.import.so
diff --git a/batch-driver.scm b/batch-driver.scm
index 87e34d3f..8c67ec14 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -45,6 +45,7 @@
 	chicken.extras
 	chicken.files
 	chicken.format
+	chicken.pretty-print
 	chicken.compiler.support
 	chicken.compiler.compiler-syntax
 	chicken.compiler.core
diff --git a/chicken-install.scm b/chicken-install.scm
index 60430ea1..9f396101 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -40,6 +40,7 @@
 	  chicken.irregex
 	  chicken.ports
 	  chicken.posix
+	  chicken.pretty-print
 	  chicken.utils)
 
   (include "mini-srfi-1.scm")
@@ -60,6 +61,7 @@
       "chicken.lolevel.import.so"
       "chicken.ports.import.so"
       "chicken.posix.import.so"
+      "chicken.pretty-print.import.so"
       "chicken.random.import.so"
       "chicken.repl.import.so"
       "chicken.tcp.import.so"
diff --git a/chicken-status.scm b/chicken-status.scm
index 6a243097..1e00bad2 100644
--- a/chicken-status.scm
+++ b/chicken-status.scm
@@ -38,7 +38,8 @@
 	  chicken.format
 	  chicken.irregex
 	  chicken.ports
-	  chicken.posix)
+	  chicken.posix
+	  chicken.pretty-print)
 
   (include "mini-srfi-1.scm")
 
diff --git a/core.scm b/core.scm
index 7a2f7406..a09f7d38 100644
--- a/core.scm
+++ b/core.scm
@@ -324,7 +324,8 @@
 	chicken.expand
 	chicken.extras
 	chicken.foreign
-	chicken.format)
+	chicken.format
+	chicken.pretty-print)
 
 (define (d arg1 . more)
   (when (##sys#fudge 13)		; debug mode?
diff --git a/csi.scm b/csi.scm
index 61e29d0e..5cc46ba6 100644
--- a/csi.scm
+++ b/csi.scm
@@ -58,6 +58,7 @@ EOF
 	chicken.extras
 	chicken.format
 	chicken.ports
+	chicken.pretty-print
 	chicken.repl)
 
 
diff --git a/defaults.make b/defaults.make
index 9af0e3d0..8f46a069 100644
--- a/defaults.make
+++ b/defaults.make
@@ -264,7 +264,7 @@ CHICKEN_PROGRAM_OPTIONS += $(if $(PROFILE_OBJECTS),-profile)
 
 PRIMITIVE_IMPORT_LIBRARIES = chicken csi chicken.foreign
 DYNAMIC_IMPORT_LIBRARIES = setup-api setup-download srfi-4
-DYNAMIC_CHICKEN_IMPORT_LIBRARIES = bitwise format posix random
+DYNAMIC_CHICKEN_IMPORT_LIBRARIES = bitwise format posix pretty-print random
 DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES = data-structures eval repl expand \
 	continuation extras files internal irregex lolevel ports tcp utils
 
diff --git a/distribution/manifest b/distribution/manifest
index aaec1a15..af96b06d 100644
--- a/distribution/manifest
+++ b/distribution/manifest
@@ -272,6 +272,8 @@ chicken.ports.import.scm
 chicken.ports.import.c
 chicken.posix.import.scm
 chicken.posix.import.c
+chicken.pretty-print.import.scm
+chicken.pretty-print.import.c
 chicken.random.import.scm
 chicken.random.import.c
 chicken.repl.import.scm
diff --git a/eval.scm b/eval.scm
index 2aa6d040..1d1136bc 100644
--- a/eval.scm
+++ b/eval.scm
@@ -88,6 +88,7 @@
     (chicken.lolevel . lolevel)
     (chicken.ports . ports)
     (chicken.posix . posix)
+    (chicken.pretty-print . extras)
     (chicken.tcp . tcp)
     (chicken.repl . repl)
     (chicken.utils . utils)))
diff --git a/extras.scm b/extras.scm
index e7f8cb62..3d7491f6 100644
--- a/extras.scm
+++ b/extras.scm
@@ -30,13 +30,11 @@
  (uses data-structures))
 
 (module chicken.extras
-  (pp pretty-print pretty-print-width
-   read-buffered read-byte read-file read-line
+  (read-buffered read-byte read-file read-line
    read-lines read-string read-string! read-token
    write-byte write-line write-string)
 
 (import scheme chicken)
-(import chicken.data-structures)
 
 (include "common-declarations.scm")
 
@@ -245,7 +243,7 @@
   (##sys#check-output-port port #t 'write-byte)
   (##sys#write-char-0 (integer->char byte) port) )
 
-
+) ; module chicken.extras
 
 
 ;;; Pretty print:
@@ -257,6 +255,12 @@
 ; Modified by felix for use with CHICKEN
 ;
 
+(module chicken.pretty-print
+  (pp pretty-print pretty-print-width)
+
+(import scheme chicken
+	chicken.data-structures)
+
 (define generic-write
   (lambda (obj display? width output)
 
@@ -562,9 +566,7 @@
     (generic-write obj #f (pretty-print-width) (lambda (s) (display s port) #t))
     (##core#undefined) ) )
 
-(define pp pretty-print)
-
-) ; module chicken.extras
+(define pp pretty-print))
 
 
 ;;; Write simple formatted output:
diff --git a/manual/Unit extras b/manual/Unit extras
index bf63656e..4583b8db 100644
--- a/manual/Unit extras	
+++ b/manual/Unit extras	
@@ -102,6 +102,7 @@ The optional {{DESTINATION}}, when supplied, performs:
 
 === Pretty-printing
 
+These procedures are provided by the {{(chicken pretty-print)}} module.
 
 ==== pretty-print
 
diff --git a/modules.scm b/modules.scm
index b0fe4f78..63c2bd7b 100644
--- a/modules.scm
+++ b/modules.scm
@@ -943,6 +943,7 @@
 (##sys#register-module-alias 'lolevel 'chicken.lolevel)
 (##sys#register-module-alias 'ports 'chicken.ports)
 (##sys#register-module-alias 'posix 'chicken.posix)
+(##sys#register-module-alias 'pretty-print 'chicken.pretty-print)
 (##sys#register-module-alias 'random 'chicken.random)
 (##sys#register-module-alias 'repl 'chicken.repl)
 (##sys#register-module-alias 'tcp 'chicken.tcp)
diff --git a/rules.make b/rules.make
index 704922c7..a44f15a3 100644
--- a/rules.make
+++ b/rules.make
@@ -520,6 +520,7 @@ $(foreach lib, $(filter-out chicken,$(COMPILER_OBJECTS_1)),\
 $(eval $(call declare-emitted-import-lib-dependency,chicken.posix,$(POSIXFILE)))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))
+$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))
 
 chicken.c: chicken.scm mini-srfi-1.scm \
@@ -538,7 +539,8 @@ batch-driver.c: batch-driver.scm mini-srfi-1.scm \
 		chicken.compiler.c-backend.import.scm \
 		chicken.compiler.support.import.scm \
 		chicken.data-structures.import.scm \
-		chicken.format.import.scm
+		chicken.format.import.scm \
+		chicken.pretty-print.import.scm
 c-platform.c: c-platform.scm mini-srfi-1.scm \
 		chicken.compiler.optimizer.import.scm \
 		chicken.compiler.support.import.scm \
@@ -562,7 +564,8 @@ core.c: core.scm mini-srfi-1.scm \
 		chicken.eval.import.scm \
 		chicken.expand.import.scm \
 		chicken.extras.import.scm \
-		chicken.format.import.scm
+		chicken.format.import.scm \
+		chicken.pretty-print.import.scm
 optimizer.c: optimizer.scm mini-srfi-1.scm \
 		chicken.compiler.support.import.scm \
 		chicken.data-structures.import.scm \
@@ -578,7 +581,8 @@ scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \
 		chicken.extras.import.scm \
 		chicken.files.import.scm \
 		chicken.format.import.scm \
-		chicken.ports.import.scm
+		chicken.ports.import.scm \
+		chicken.pretty-print.import.scm
 lfa2.c: lfa2.scm mini-srfi-1.scm \
 		chicken.compiler.support.import.scm \
 		chicken.extras.import.scm \
@@ -600,6 +604,7 @@ support.c: support.scm mini-srfi-1.scm \
 		chicken.foreign.import.scm \
 		chicken.format.import.scm \
 		chicken.ports.import.scm \
+		chicken.pretty-print.import.scm \
 		chicken.random.import.scm
 csc.c: csc.scm \
 		chicken.posix.import.scm \
@@ -613,7 +618,8 @@ csi.c: csi.scm \
 		chicken.data-structures.import.scm \
 		chicken.extras.import.scm \
 		chicken.format.import.scm \
-		chicken.ports.import.scm
+		chicken.ports.import.scm \
+		chicken.pretty-print.import.scm
 chicken-bug.c: chicken-bug.scm \
 		chicken.data-structures.import.scm \
 		chicken.extras.import.scm \
@@ -632,6 +638,7 @@ chicken-status.c: chicken-status.scm \
 		chicken.irregex.import.scm \
 		chicken.ports.import.scm \
 		chicken.posix.import.scm \
+		chicken.pretty-print.import.scm \
 		setup-api.import.scm
 chicken-install.c: chicken-install.scm \
 		chicken.data-structures.import.scm \
@@ -642,6 +649,7 @@ chicken-install.c: chicken-install.scm \
 		chicken.irregex.import.scm \
 		chicken.ports.import.scm \
 		chicken.posix.import.scm \
+		chicken.pretty-print.import.scm \
 		chicken.utils.import.scm \
 		setup-api.import.scm \
 		setup-download.import.scm
@@ -665,6 +673,7 @@ setup-api.c: setup-api.scm \
 		chicken.irregex.import.scm \
 		chicken.ports.import.scm \
 		chicken.posix.import.scm \
+		chicken.pretty-print.import.scm \
 		chicken.utils.import.scm
 setup-download.c: setup-download.scm \
 		chicken.data-structures.import.scm \
@@ -747,6 +756,7 @@ extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm
 	$(bootstrap-lib) \
 	-emit-import-library chicken.extras \
 	-emit-import-library chicken.format \
+	-emit-import-library chicken.pretty-print \
 	-emit-import-library chicken.random
 posixunix.c: $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm
 	$(bootstrap-lib) -emit-import-library chicken.posix
diff --git a/scrutinizer.scm b/scrutinizer.scm
index aa4d1dce..3f94060d 100644
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -39,7 +39,8 @@
 	chicken.extras
 	chicken.format
 	chicken.files
-	chicken.ports)
+	chicken.ports
+	chicken.pretty-print)
 
 (include "tweaks")
 (include "mini-srfi-1.scm")
diff --git a/setup-api.scm b/setup-api.scm
index 7250db59..b216bef5 100644
--- a/setup-api.scm
+++ b/setup-api.scm
@@ -73,6 +73,7 @@
 	  chicken.format
 	  chicken.ports
 	  chicken.posix
+	  chicken.pretty-print
 	  chicken.irregex
 	  chicken.utils)
 
diff --git a/support.scm b/support.scm
index 2b57ec97..ccc1b25c 100644
--- a/support.scm
+++ b/support.scm
@@ -83,6 +83,7 @@
 	chicken.foreign
 	chicken.format
 	chicken.ports
+	chicken.pretty-print
 	chicken.random)
 
 (include "tweaks")
diff --git a/tests/arithmetic-test.scm b/tests/arithmetic-test.scm
index e1b56d7c..d03dd1ae 100644
--- a/tests/arithmetic-test.scm
+++ b/tests/arithmetic-test.scm
@@ -15,7 +15,7 @@
   (else))
 
 
-(use extras random)
+(use pretty-print random)
 
 #+use-numbers (use numbers)
 
diff --git a/tests/embedded2.scm b/tests/embedded2.scm
index 7c38ddf6..aae672db 100644
--- a/tests/embedded2.scm
+++ b/tests/embedded2.scm
@@ -1,4 +1,4 @@
-(use extras)
+(use pretty-print)
 
 #>
 #include <assert.h>
diff --git a/tests/functor-tests.scm b/tests/functor-tests.scm
index 5db07414..3f0588b1 100644
--- a/tests/functor-tests.scm
+++ b/tests/functor-tests.scm
@@ -1,7 +1,7 @@
 ;;;; functor-tests.scm
 
 
-(use data-structures extras ports)
+(use data-structures ports pretty-print)
 
 
 (include "test.scm")
diff --git a/tests/pp-test.scm b/tests/pp-test.scm
index b7f8f593..500d6b70 100644
--- a/tests/pp-test.scm
+++ b/tests/pp-test.scm
@@ -1,6 +1,6 @@
 ;;;; pp-test.scm
 
-(use (only extras pp)
+(use (only pretty-print pp)
      (only ports with-output-to-string))
 
 (define (pp->string thing)
diff --git a/tests/reexport-tests.scm b/tests/reexport-tests.scm
index 651ed476..1d307a92 100644
--- a/tests/reexport-tests.scm
+++ b/tests/reexport-tests.scm
@@ -29,7 +29,7 @@
 
 (compound-module 
  big-chicken
- chicken ports files extras data-structures)
+ chicken ports files extras pretty-print data-structures)
 
 (require-library extras data-structures)
 
diff --git a/tests/runtests.sh b/tests/runtests.sh
index 3be7a36a..abe14a6e 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -51,6 +51,7 @@ for x in \
     chicken.lolevel.import.so \
     chicken.ports.import.so \
     chicken.posix.import.so \
+    chicken.pretty-print.import.so \
     chicken.random.import.so \
     chicken.repl.import.so \
     chicken.tcp.import.so \
diff --git a/tests/syntax-tests.scm b/tests/syntax-tests.scm
index fd42dac1..3798790b 100644
--- a/tests/syntax-tests.scm
+++ b/tests/syntax-tests.scm
@@ -1,7 +1,7 @@
 ;;;; syntax-tests.scm - various macro tests
 
-(use-for-syntax extras)
-(use extras)
+(use-for-syntax pretty-print)
+(use pretty-print)
 
 
 (define-syntax t
@@ -564,7 +564,7 @@
   (s:define bar 99))
 
 (module m0002 ()
-  (import scheme m0001 extras)
+  (import scheme m0001 pretty-print)
   (pp (foo bar)))
 
 
diff --git a/types.db b/types.db
index 7a4e7438..42c1ef21 100644
--- a/types.db
+++ b/types.db
@@ -1519,9 +1519,6 @@
 
 ;; extras
 
-(chicken.extras#pp (#(procedure #:enforce) chicken.extras#pp (* #!optional output-port) undefined))
-(chicken.extras#pretty-print (#(procedure #:enforce) chicken.extras#pretty-print (* #!optional output-port) undefined))
-(chicken.extras#pretty-print-width (#(procedure #:clean) chicken.extras#pretty-print-width (#!optional fixnum) *))
 (chicken.extras#read-buffered (#(procedure #:enforce) chicken.extras#read-buffered (#!optional input-port) string))
 (chicken.extras#read-byte (#(procedure #:enforce) chicken.extras#read-byte (#!optional input-port) *))
 (chicken.extras#read-file (#(procedure #:enforce) chicken.extras#read-file (#!optional (or input-port string) (procedure (input-port) *) fixnum) list))
@@ -1534,6 +1531,14 @@
 (chicken.extras#write-line (#(procedure #:enforce) chicken.extras#write-line (string #!optional output-port) undefined))
 (chicken.extras#write-string (#(procedure #:enforce) chicken.extras#write-string (string #!optional * output-port) undefined))
 
+;; pretty-print
+
+(chicken.pretty-print#pp (#(procedure #:enforce) chicken.pretty-print#pp (* #!optional output-port) undefined))
+(chicken.pretty-print#pretty-print (#(procedure #:enforce) chicken.pretty-print#pretty-print (* #!optional output-port) undefined))
+(chicken.pretty-print#pretty-print-width (#(procedure #:clean) chicken.pretty-print#pretty-print-width (#!optional fixnum) *))
+
+;; format
+
 (chicken.format#format (procedure chicken.format#format (#!rest) *))
 (chicken.format#fprintf (#(procedure #:enforce) chicken.format#fprintf (output-port string #!rest) undefined))
 (chicken.format#printf (#(procedure #:enforce) chicken.format#printf (string #!rest) undefined))
Trap