] unless ;
: compiling ( word -- word parameter )
- check-architecture "Compiling " write dup pp dup word-def ;
+ check-architecture "Compiling " write dup . dup word-def ;
GENERIC: (compile) ( word -- )
"compile" get [ word compile ] when ; parsing
: cannot-compile ( word error -- )
- "Cannot compile " write swap pp print-error ;
+ "Cannot compile " write swap . print-error ;
: try-compile ( word -- )
[ compile ] [ [ cannot-compile ] when* ] catch ;
: decompile ( word -- )
dup compiled? [
- "Decompiling " write dup pp
+ "Decompiling " write dup .
[ word-primitive ] keep set-word-primitive
] [
drop
: dataflow. ( quot ? -- )
#! Print dataflow IR for a quotation. Flag indicates if
#! annotations should be printed or not.
- >r dataflow optimize r> dataflow>quot pp ;
+ >r dataflow optimize r> dataflow>quot . ;
: pprint>string ( object -- string )
[ pprint ] string-out ;
-: pp ( obj -- ) pprint terpri ;
+: . ( obj -- ) pprint terpri ;
-: . ( obj -- )
- [ 2 nesting-limit set 100 length-limit set pp ] with-scope ;
+: pprint-short ( object -- string )
+ [
+ 1 line-limit set
+ 5 length-limit set
+ 2 nesting-limit set
+ pprint
+ ] with-scope ;
+
+: pprint>short-string ( object -- string )
+ [ pprint-short ] string-out ;
: [.] ( sequence -- )
#! Unparse each element on its own line.
- [
- 1 line-limit set 10 length-limit set
- [ pp ] each
- ] with-scope ;
+ [ [ pprint>short-string print ] each ] with-scope ;
: stack. reverse-slice [.] ;
: type-check-error. ( list -- )
"Type check error" print
uncons car dup "Object: " write .
- "Object type: " write class pp
- "Expected type: " write type>class pp ;
+ "Object type: " write class .
+ "Expected type: " write type>class . ;
: float-format-error. ( list -- )
"Invalid floating point literal format: " write . ;
tuck [ execute ] map-with
2list ;
-PREDICATE: list nonvoid cons? ;
-
-M: nonvoid sheet unit ;
+M: list sheet unit ;
M: vector sheet unit ;
M: hashtable sheet dup hash-keys swap hash-values 2list ;
: format-column ( list -- list )
- [ unparse ] map
+ [ pprint>short-string ] map
[ max-length ] keep
[ swap CHAR: \s pad-right ] map-with ;
"This is an orphan not part of the dictionary." print
"It claims to belong to the " write
] ifte
- word-vocabulary unparse write " vocabulary." print
+ word-vocabulary pprint " vocabulary." print
] [
drop
"The word is a uniquely generated symbol." print
: inspect-banner ( obj -- )
"You are looking at an instance of the " write dup class pprint
" class:" print
- " " write dup pp
+ " " write dup pprint-short terpri
"It takes up " write dup size pprint " bytes of memory." print
extra-banner ;
"This stream does not support live gadgets"
swap format terpri ;
-[ drop t ] "Prettyprint" [ pp ] define-command
+[ drop t ] "Prettyprint" [ . ] define-command
[ drop t ] "Inspect" [ inspect ] define-command
[ drop t ] "References" [ references inspect ] define-command