]> gitweb.factorcode.org Git - factor.git/commitdiff
clean up the bootstrap mess by moving the struct summary and make-mirror methods...
authorJoe Groff <arcata@gmail.com>
Tue, 1 Sep 2009 01:32:00 +0000 (20:32 -0500)
committerJoe Groff <arcata@gmail.com>
Tue, 1 Sep 2009 01:32:00 +0000 (20:32 -0500)
basis/classes/struct/prettyprint/prettyprint.factor
basis/mirrors/mirrors.factor
basis/summary/summary.factor

index 349303d1138831414a103d9765dcd02da6351708..253f90442083fad9bc8a5e7f59d77072986f2574 100644 (file)
@@ -1,7 +1,9 @@
 ! (c)Joe Groff bsd license
-USING: accessors alien assocs classes classes.struct
-combinators kernel math prettyprint.backend prettyprint.custom
-prettyprint.sections see.private sequences strings words ;
+USING: accessors alien alien.c-types arrays assocs classes
+classes.struct combinators continuations fry kernel make math
+math.parser mirrors prettyprint.backend prettyprint.custom
+prettyprint.sections see.private sequences strings
+summary words ;
 IN: classes.struct.prettyprint
 
 <PRIVATE
@@ -46,3 +48,21 @@ M: struct >pprint-sequence
 M: struct pprint*
     [ pprint-struct ]
     [ pprint-struct-pointer ] pprint-c-object ;
+
+M: struct summary
+    [
+        dup class name>> %
+        " struct of " %
+        byte-length #
+        " bytes " %
+    ] "" make ;
+
+M: struct make-mirror
+    [
+        [ drop "underlying" ] [ (underlying)>> ] bi 2array 1array
+    ] [
+        '[
+            _ struct>assoc
+            [ [ [ name>> ] [ c-type>> ] bi 2array ] dip ] assoc-map
+        ] [ drop { } ] recover
+    ] bi append ;
index d9120da9dc8e215bacfc81998e62fe04e0d830d8..25486d127deb83c5bfc1ebd8b6e6d53ee545a139 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes classes.struct
-classes.struct.prettyprint.private classes.tuple
-classes.tuple.private combinators generic hashtables kernel
-math quotations sequences slots slots.private vectors words
-continuations fry ;
+USING: assocs hashtables kernel sequences generic words
+arrays classes slots slots.private classes.tuple
+classes.tuple.private math vectors quotations accessors
+combinators ;
 IN: mirrors
 
 TUPLE: mirror { object read-only } ;
@@ -56,13 +55,3 @@ M: array make-mirror <enum> ;
 M: vector make-mirror <enum> ;
 M: quotation make-mirror <enum> ;
 M: object make-mirror <mirror> ;
-
-M: struct make-mirror
-    [
-        [ drop "underlying" ] [ (underlying)>> ] bi 2array 1array
-    ] [
-        '[
-            _ struct>assoc
-            [ [ [ name>> ] [ c-type>> ] bi 2array ] dip ] assoc-map
-        ] [ drop { } ] recover
-    ] bi append ;
index d8542c7f83019901b7eb5cf63616aa264e31cb69..44e5374dc52d7a6cd53f2ebddc25aaa4ca1eb899 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors classes sequences kernel namespaces
-make words math math.parser assocs classes.struct
-alien.c-types ;
+make words math math.parser assocs ;
 IN: summary
 
 GENERIC: summary ( object -- string )
@@ -32,11 +31,3 @@ M: assoc summary
 M: f summary object-summary ;
 
 M: integer summary object-summary ;
-
-M: struct summary
-    [
-        dup class name>> %
-        " struct of " %
-        byte-length #
-        " bytes " %
-    ] "" make ;