SYMBOL: string-limit?
SYMBOL: boa-tuples?
SYMBOL: c-object-pointers?
+SYMBOL: has-limits?
4 tab-size set-global
64 margin set-global
100 length-limit set-global
10 number-base set-global
t string-limit? set-global
+f has-limits? set-global
-: with-short-limits ( quot -- )
+: (with-short-limits) ( quot -- )
H{
{ line-limit 1 }
{ length-limit 15 }
{ string-limit? t }
{ boa-tuples? t }
{ c-object-pointers? f }
+ { has-limits? t }
} clone swap with-variables ; inline
-: without-limits ( quot -- )
+: with-short-limits ( quot -- )
+ has-limits? get [ call ] [ (with-short-limits) ] if ; inline
+
+: (without-limits) ( quot -- )
H{
{ nesting-limit f }
{ length-limit f }
{ line-limit f }
{ string-limit? f }
{ c-object-pointers? f }
+ { has-limits? t }
} clone swap with-variables ; inline
+
+: without-limits ( quot -- )
+ has-limits? get [ call ] [ (without-limits) ] if ; inline
{ "{ ~array~ }\n" } [ [ { { 1 2 } } short. ] with-string-writer ] unit-test
+{ "{ { 1 2 } }\n" } [ [ [ { { 1 2 } } short. ] without-limits ] with-string-writer ] unit-test
+
+{ "{ ~array~ }\n" } [ [ [ { { 1 2 } } . ] with-short-limits ] with-string-writer ] unit-test
+
{ "H{ { 1 { 2 3 } } }\n" } [
f nesting-limit [
[ H{ { 1 { 2 3 } } } . ] with-string-writer