~ chicken-core (master) e7632fe06c80f22b268f32bc9ed08ab5a2014e9c
commit e7632fe06c80f22b268f32bc9ed08ab5a2014e9c
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Sun Sep 25 14:23:11 2011 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Mon Sep 26 09:10:55 2011 +0200
pretty printer shows blobs readably
diff --git a/extras.scm b/extras.scm
index 151ca95a..bb9e4343 100644
--- a/extras.scm
+++ b/extras.scm
@@ -380,11 +380,15 @@
(out (get-output-string o) col) ) )
((port? obj) (out (string-append "#<port " (##sys#slot obj 3) ">") col))
((##core#inline "C_bytevectorp" obj)
- (if (##core#inline "C_permanentp" obj)
- (out "#<static blob of size" col)
- (out "#<blob of size " col) )
- (out (number->string (##core#inline "C_block_size" obj)) col)
- (out ">" col) )
+ (out "#${" col)
+ (let ((len (##sys#size obj)))
+ (do ((i 0 (fx+ i 1)))
+ ((fx>= i len))
+ (let ((b (##sys#byte obj i)))
+ (when (fx< b 16)
+ (out "0" col))
+ (out (##sys#number->string b 16) col)))
+ (out "}" col)))
((##core#inline "C_lambdainfop" obj)
(out "#<lambda info " col)
(out (##sys#lambda-info->string obj) col)
Trap