]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/see/see.factor
use reject instead of [ ... not ] filter.
[factor.git] / basis / see / see.factor
index 38a8a489349ad557bd603a0a6941c3ea67a14710..b43b53de2370d1b7c1fb398545819c245691f939 100644 (file)
@@ -6,8 +6,8 @@ classes.tuple classes.union combinators definitions effects generic
 generic.single generic.standard generic.hook io io.pathnames
 io.streams.string io.styles kernel make namespaces prettyprint
 prettyprint.backend prettyprint.config prettyprint.custom
-prettyprint.sections sequences sets sorting strings summary words
-words.symbol words.constant words.alias vocabs slots ;
+prettyprint.sections sequences sets slots sorting strings summary
+words words.symbol words.constant words.alias vocabs ;
 FROM: namespaces => set ;
 FROM: classes => members ;
 RENAME: members sets => set-members
@@ -21,6 +21,7 @@ GENERIC: see* ( defspec -- )
 
 : synopsis ( defspec -- str )
     [
+        string-limit? off
         0 margin set
         1 line-limit set
         [ synopsis* ] with-in
@@ -47,7 +48,7 @@ M: word print-stack-effect? drop t ;
 <PRIVATE
 
 : seeing-word ( word -- )
-    vocabulary>> dup [ vocab ] when pprinter-in set ;
+    vocabulary>> dup [ lookup-vocab ] when pprinter-in set ;
 
 : word-synopsis ( word -- )
     {
@@ -81,7 +82,7 @@ M: hook-generic synopsis*
 
 M: method synopsis*
     [ definer. ]
-    [ "method-class" word-prop pprint-word ]
+    [ "method-class" word-prop pprint-class ]
     [ "method-generic" word-prop pprint-word ] tri ;
 
 M: mixin-instance synopsis*
@@ -91,6 +92,19 @@ M: mixin-instance synopsis*
 
 M: pathname synopsis* pprint* ;
 
+M: alias summary
+    [
+        0 margin set 1 line-limit set
+        [
+            {
+                [ seeing-word ]
+                [ definer. ]
+                [ pprint-word ]
+                [ stack-effect pprint-effect ]
+            } cleave
+        ] with-in
+    ] with-string-writer ;
+
 M: word summary synopsis ;
 
 GENERIC: declarations. ( obj -- )
@@ -139,7 +153,7 @@ M: mixin-class see-class*
     <block \ MIXIN: pprint-word
     dup pprint-word <block
     dup members [
-        hard line-break
+        hard add-line-break
         \ INSTANCE: pprint-word pprint-word pprint-word
     ] with each block> block> ;
 
@@ -204,7 +218,11 @@ M: tuple-class see-class*
 M: word see-class* drop ;
 
 M: builtin-class see-class*
-    drop "! Built-in class" comment. ;
+    <block
+    \ BUILTIN: pprint-word
+    [ pprint-word ]
+    [ <block "slots" word-prop [ pprint-slot ] each pprint-; block> ] bi
+    block> ;
 
 : see-class ( class -- )
     dup class? [
@@ -223,8 +241,8 @@ M: word see*
 
 : seeing-implementors ( class -- seq )
     dup implementors
-    [ [ reader? ] [ writer? ] bi or not ] filter
-    [ method ] with map
+    [ [ reader? ] [ writer? ] bi or ] reject
+    [ lookup-method ] with map
     natural-sort ;
 
 : seeing-methods ( generic -- seq )