]> gitweb.factorcode.org Git - factor.git/commitdiff
banish typed prettyprinting to its own vocab
authorJoe Groff <arcata@gmail.com>
Sat, 17 Oct 2009 03:16:31 +0000 (22:16 -0500)
committerJoe Groff <arcata@gmail.com>
Sat, 17 Oct 2009 03:16:31 +0000 (22:16 -0500)
extra/typed/prettyprint/prettyprint.factor [new file with mode: 0644]
extra/typed/typed.factor

diff --git a/extra/typed/prettyprint/prettyprint.factor b/extra/typed/prettyprint/prettyprint.factor
new file mode 100644 (file)
index 0000000..8a7ff5b
--- /dev/null
@@ -0,0 +1,11 @@
+USING: definitions kernel locals.definitions see see.private typed words ;
+IN: typed.prettyprint
+
+PREDICATE: typed-lambda-word < lambda-word "typed-word" word-prop ;
+
+M: typed-word definer drop \ TYPED: \ ; ;
+M: typed-lambda-word definer drop \ TYPED:: \ ; ;
+
+M: typed-word definition "typed-def" word-prop ;
+M: typed-word declarations. "typed-word" word-prop declarations. ;
+
index bf231014213883cbd44d60b19b68b348870fbacd..84a8ea3217353a2b04e39a5cefb220821b635b66 100644 (file)
@@ -2,7 +2,7 @@
 USING: accessors arrays classes classes.tuple combinators
 combinators.short-circuit definitions effects fry hints
 math kernel kernel.private namespaces parser quotations
-see see.private sequences slots words locals locals.definitions
+sequences slots words locals 
 locals.parser macros stack-checker.state ;
 IN: typed
 
@@ -11,8 +11,7 @@ ERROR: input-mismatch-error < type-mismatch-error ;
 ERROR: output-mismatch-error < type-mismatch-error ;
 
 PREDICATE: typed-gensym < word "typed-gensym" word-prop ;
-PREDICATE: typed-standard-word < word "typed-word" word-prop ;
-PREDICATE: typed-lambda-word < lambda-word "typed-word" word-prop ;
+PREDICATE: typed-word < word "typed-word" word-prop ;
 
 <PRIVATE
 
@@ -117,8 +116,6 @@ M: typed-gensym crossref?
     [ [ (typed) ] 3curry ]
     [ 2nip ] 3tri define-declared ;
 
-UNION: typed-word typed-standard-word typed-lambda-word ;
-
 MACRO: typed ( quot word effect -- quot' )
     [ effect-in-types (depends-on) dup typed-stack-effect? [ typed-inputs ] [ 2drop ] if ] 
     [
@@ -137,6 +134,10 @@ MACRO: typed ( quot word effect -- quot' )
         [ effect-out-types typed-stack-effect? ]
     } 1|| [ (typed-def) ] [ drop nip ] if ;
 
+M: typed-word subwords
+    [ call-next-method ]
+    [ "typed-word" word-prop ] bi suffix ;
+
 PRIVATE>
 
 : define-typed ( word def effect -- )
@@ -149,13 +150,6 @@ SYNTAX: TYPED:
 SYNTAX: TYPED::
     (::) define-typed ;
 
-M: typed-standard-word definer drop \ TYPED: \ ; ;
-M: typed-lambda-word definer drop \ TYPED:: \ ; ;
-
-M: typed-word definition "typed-def" word-prop ;
-M: typed-word declarations. "typed-word" word-prop declarations. ;
-
-M: typed-word subwords
-    [ call-next-method ]
-    [ "typed-word" word-prop ] bi suffix ;
+USING: vocabs vocabs.loader ;
 
+"prettyprint" vocab [ "typed.prettyprint" require ] when