prettyprint: document "~1 more~" behavior (funny because it takes as much as room as... 1 more).

db4
John Benediktsson 2012-06-01 15:15:29 -07:00
parent 65a79dbe4d
commit b4018e9296
2 changed files with 11 additions and 1 deletions

View File

@ -195,7 +195,7 @@ M: tuple pprint*
: do-length-limit ( seq -- trimmed n/f )
length-limit get dup [
over length over [-]
dup zero? [ 2drop f ] [ [ head-slice ] dip ] if
[ drop f ] [ [ head-slice ] dip ] if-zero
] when ;
: pprint-elements ( seq -- )

View File

@ -455,3 +455,13 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ;
] [
[ maybe{ maybe{ integer } } . ] with-string-writer
] unit-test
{ "{ 0 1 2 3 4 }" } [
[ 5 length-limit [ 5 iota >array pprint ] with-variable ]
with-string-writer
] unit-test
{ "{ 0 1 2 3 4 ~1 more~ }" } [
[ 5 length-limit [ 6 iota >array pprint ] with-variable ]
with-string-writer
] unit-test