diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index a2696b1263..b3897960f0 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -303,3 +303,54 @@ M: started-out-hustlin' ended-up-ballin' ; inline [ "USING: prettyprint.tests ;\nM: started-out-hustlin' ended-up-ballin' ; inline\n" ] [ [ M\ started-out-hustlin' ended-up-ballin' see ] with-string-writer ] unit-test + +TUPLE: tuple-with-declared-slot { x integer } ; + +[ + { + "USING: math ;" + "IN: prettyprint.tests" + "TUPLE: tuple-with-declared-slot { x integer initial: 0 } ;" + "" + } +] [ + [ \ tuple-with-declared-slot see ] with-string-writer "\n" split +] unit-test + +TUPLE: tuple-with-read-only-slot { x read-only } ; + +[ + { + "IN: prettyprint.tests" + "TUPLE: tuple-with-read-only-slot { x read-only } ;" + "" + } +] [ + [ \ tuple-with-read-only-slot see ] with-string-writer "\n" split +] unit-test + +TUPLE: tuple-with-initial-slot { x initial: 123 } ; + +[ + { + "IN: prettyprint.tests" + "TUPLE: tuple-with-initial-slot { x initial: 123 } ;" + "" + } +] [ + [ \ tuple-with-initial-slot see ] with-string-writer "\n" split +] unit-test + +TUPLE: tuple-with-initial-declared-slot { x integer initial: 123 } ; + +[ + { + "USING: math ;" + "IN: prettyprint.tests" + "TUPLE: tuple-with-initial-declared-slot" + " { x integer initial: 123 } ;" + "" + } +] [ + [ \ tuple-with-initial-declared-slot see ] with-string-writer "\n" split +] unit-test diff --git a/basis/see/see.factor b/basis/see/see.factor index a8d78a68e4..206bdbb906 100644 --- a/basis/see/see.factor +++ b/basis/see/see.factor @@ -165,12 +165,14 @@ M: array pprint-slot-name dup name>> , dup class>> object eq? [ dup class>> , - initial: , - dup initial>> , ] unless dup read-only>> [ read-only , ] when + dup [ class>> object eq? not ] [ initial>> ] bi or [ + initial: , + dup initial>> , + ] when drop ] { } make ;