make simplify-callable prettyprinting an optional load in extra

db4
Joe Groff 2009-08-07 16:19:46 -04:00
parent 556904cf57
commit fcfe16d8d0
6 changed files with 12 additions and 10 deletions

View File

@ -3,9 +3,8 @@
USING: accessors arrays byte-arrays byte-vectors generic hashtables USING: accessors arrays byte-arrays byte-vectors generic hashtables
assocs kernel math namespaces make sequences strings sbufs vectors assocs kernel math namespaces make sequences strings sbufs vectors
words prettyprint.config prettyprint.custom prettyprint.sections words prettyprint.config prettyprint.custom prettyprint.sections
prettyprint.backend.callables quotations io io.pathnames io.styles quotations io io.pathnames io.styles math.parser effects classes.tuple
math.parser effects classes.tuple math.order classes.tuple.private math.order classes.tuple.private classes combinators colors ;
classes combinators colors ;
IN: prettyprint.backend IN: prettyprint.backend
M: effect pprint* effect>string "(" ")" surround text ; M: effect pprint* effect>string "(" ")" surround text ;
@ -178,7 +177,7 @@ M: callstack pprint-delims drop \ CS{ \ } ;
M: object >pprint-sequence ; M: object >pprint-sequence ;
M: vector >pprint-sequence ; M: vector >pprint-sequence ;
M: byte-vector >pprint-sequence ; M: byte-vector >pprint-sequence ;
M: callable >pprint-sequence simplify-callable ; M: callable >pprint-sequence ;
M: hashtable >pprint-sequence >alist ; M: hashtable >pprint-sequence >alist ;
M: wrapper >pprint-sequence wrapped>> 1array ; M: wrapper >pprint-sequence wrapped>> 1array ;
M: callstack >pprint-sequence callstack>array ; M: callstack >pprint-sequence callstack>array ;

View File

@ -1,5 +1,5 @@
USING: help help.markup help.syntax ; USING: help help.markup help.syntax kernel quotations ;
IN: prettyprint.backend.callables IN: prettyprint.callables
HELP: simplify-callable HELP: simplify-callable
{ $values { "quot" callable } { "quot'" callable } } { $values { "quot" callable } { "quot'" callable } }

View File

@ -1,7 +1,7 @@
! (c) 2009 Joe Groff bsd license ! (c) 2009 Joe Groff bsd license
USING: kernel math prettyprint prettyprint.backend.callables USING: kernel math prettyprint prettyprint.callables
tools.test ; tools.test ;
IN: prettyprint.backend.callables IN: prettyprint.callables.tests
[ [ dip ] ] [ [ dip ] simplify-callable ] unit-test [ [ dip ] ] [ [ dip ] simplify-callable ] unit-test
[ [ [ + ] dip ] ] [ [ [ + ] dip ] simplify-callable ] unit-test [ [ [ + ] dip ] ] [ [ [ + ] dip ] simplify-callable ] unit-test

View File

@ -1,7 +1,8 @@
! (c) 2009 Joe Groff bsd license ! (c) 2009 Joe Groff bsd license
USING: combinators combinators.short-circuit generalizations USING: combinators combinators.short-circuit generalizations
kernel macros math math.ranges quotations sequences words ; kernel macros math math.ranges prettyprint.custom quotations
IN: prettyprint.backend.callables sequences words ;
IN: prettyprint.callables
<PRIVATE <PRIVATE
@ -70,3 +71,5 @@ PRIVATE>
: simplify-callable ( quot -- quot' ) : simplify-callable ( quot -- quot' )
[ (simplify-callable) ] to-fixed-point ; [ (simplify-callable) ] to-fixed-point ;
M: callable >pprint-sequence simplify-callable ;