]> gitweb.factorcode.org Git - factor.git/commitdiff
classes.maybe: move maybe definition from classes.union to classes.maybe
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 22 Nov 2011 10:44:58 +0000 (02:44 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 22 Nov 2011 10:46:36 +0000 (02:46 -0800)
basis/compiler/tests/redefine26.factor
basis/compiler/tree/propagation/simple/simple.factor
basis/prettyprint/backend/backend.factor
basis/prettyprint/prettyprint-tests.factor
basis/typed/typed.factor
core/classes/maybe/authors.txt [new file with mode: 0644]
core/classes/maybe/maybe.factor [new file with mode: 0644]
core/classes/union/union.factor
core/generic/generic.factor
core/slots/slots.factor
core/syntax/syntax.factor

index 9aa94b3a9c5b0ac69829112ff82b47f51234fafb..7b2d89aa9dd94ae516bc62f31e267b53ac65032d 100644 (file)
@@ -1,4 +1,4 @@
-USING: accessors classes.tuple classes.union compiler.units
+USING: accessors classes.tuple classes.maybe compiler.units
 kernel math slots tools.test ;
 IN: compiler.tests.redefine26
 
index d60cf50495f1e7c145eb4507f7249d99910c0250..e1bcc07ef40e52dce3ad9efc5504a912ad203ea7 100644 (file)
@@ -5,7 +5,7 @@ words namespaces classes.algebra combinators
 combinators.short-circuit classes classes.tuple
 classes.tuple.private continuations arrays alien.c-types math
 math.private slots generic definitions stack-checker.dependencies
-classes.union classes.algebra.private
+classes.maybe classes.algebra.private
 compiler.tree
 compiler.tree.propagation.info
 compiler.tree.propagation.nodes
index 797f04774a3b663feb2f3cb3cf95b79156c62ba3..e942bfdd2f7ed2a2ab4c49ad6173850535d75abc 100644 (file)
@@ -7,7 +7,7 @@ io.pathnames io.styles kernel make math math.order math.parser
 namespaces prettyprint.config prettyprint.custom
 prettyprint.sections prettyprint.stylesheet quotations sbufs
 sequences strings vectors words words.symbol hash-sets
-classes.union ;
+classes.maybe ;
 FROM: sets => members ;
 IN: prettyprint.backend
 
index 7353cccb43af348dd90d430299723073df550de1..f9d532f7784249c6713b72d877ea482d5672153a 100644 (file)
@@ -4,7 +4,7 @@ prettyprint.sections sequences tools.test vectors words
 effects splitting generic.standard prettyprint.private
 continuations generic compiler.units tools.continuations
 tools.continuations.private eval accessors make vocabs.parser see
-listener classes.union ;
+listener classes.maybe ;
 IN: prettyprint.tests
 
 [ "4" ] [ 4 unparse ] unit-test
index 2d76d25b1396ede0e2103017052d2c8ef1cb1fd6..fc1eee608c88449cad176402d22f0a30437cea79 100644 (file)
@@ -4,7 +4,7 @@ combinators.short-circuit definitions effects fry hints
 math kernel kernel.private namespaces parser quotations
 sequences slots words locals effects.parser
 locals.parser macros stack-checker.dependencies
-classes.union ;
+classes.maybe ;
 FROM: classes.tuple.private => tuple-layout ;
 IN: typed
 
diff --git a/core/classes/maybe/authors.txt b/core/classes/maybe/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/core/classes/maybe/maybe.factor b/core/classes/maybe/maybe.factor
new file mode 100644 (file)
index 0000000..0fa63fb
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2011 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors classes classes.algebra
+classes.algebra.private classes.private effects generic
+kernel sequences words classes.union classes.union.private ;
+IN: classes.maybe
+
+TUPLE: maybe { class word initial: object read-only } ;
+
+C: <maybe> maybe
+
+M: maybe instance?
+    over [ class>> instance? ] [ 2drop t ] if ;
+
+M: maybe normalize-class
+    class>> \ f class-or ;
+
+M: maybe classoid? drop t ;
+
+M: maybe rank-class drop 6 ;
+
+M: maybe (flatten-class)
+    class>> (flatten-class) ;
+
+M: maybe effect>type ;
+
+M: maybe method-word-name
+    [ class>> name>> ] [ name>> ] bi* "=>" glue ;
+
+M: maybe union-of-builtins?
+    class>> union-of-builtins? ;
+
index fc70ae06f762c9768484818292dca4b431313e74..385719b552298fbcc34e8620e89d60094c674bb7 100644 (file)
@@ -1,33 +1,14 @@
 ! Copyright (C) 2004, 2011 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: words sequences kernel assocs combinators classes
-classes.private classes.algebra classes.algebra.private
-classes.builtin kernel.private math.private namespaces arrays
-math quotations definitions accessors parser effects ;
+USING: accessors assocs classes classes.algebra
+classes.algebra.private classes.builtin
+classes.private combinators definitions kernel kernel.private
+math math.private quotations sequences words vocabs ;
 IN: classes.union
 
 PREDICATE: union-class < class
     "metaclass" word-prop union-class eq? ;
 
-TUPLE: maybe { class word initial: object read-only } ;
-
-C: <maybe> maybe
-
-M: maybe instance?
-    over [ class>> instance? ] [ 2drop t ] if ;
-
-M: maybe normalize-class
-    class>> \ f class-or ;
-
-M: maybe classoid? drop t ;
-
-M: maybe rank-class drop 6 ;
-
-M: maybe (flatten-class)
-    class>> (flatten-class) ;
-
-M: maybe effect>type ;
-
 <PRIVATE
 
 GENERIC: union-of-builtins? ( class -- ? )
@@ -37,9 +18,6 @@ M: builtin-class union-of-builtins? drop t ;
 M: union-class union-of-builtins?
     members [ union-of-builtins? ] all? ;
 
-M: maybe union-of-builtins?
-    class>> union-of-builtins? ;
-
 M: class union-of-builtins?
     drop f ;
 
@@ -96,4 +74,3 @@ M: union-class normalize-class
 
 M: union-class (flatten-class)
     members <anonymous-union> (flatten-class) ;
-
index 6bbba70882be45f93b084c56e6a792b56dffb630..d3c13f1228114c603378f7f247adf747745a715b 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors words kernel sequences namespaces make assocs
 hashtables definitions kernel.private classes classes.private
 classes.algebra quotations arrays vocabs effects combinators
-sets classes.union ;
+sets ;
 FROM: namespaces => set ;
 IN: generic
 
@@ -109,9 +109,6 @@ GENERIC: update-generic ( class generic -- )
 
 GENERIC# method-word-name 1 ( class generic -- string )
 
-M: maybe method-word-name
-    [ class>> name>> ] [ name>> ] bi* "=>" glue ;
-
 M: class method-word-name ( class generic -- string )
     [ name>> ] bi@ "=>" glue ;
 
index adb0db558214b996ad38304f29453b34fe231f5f..5bb1630eb8deacd8f50ef73842b1ae0c19290f61 100644 (file)
@@ -4,7 +4,7 @@ USING: arrays byte-arrays kernel kernel.private math namespaces
 make sequences strings effects generic generic.standard
 classes classes.algebra slots.private combinators accessors
 words sequences.private assocs alien quotations hashtables
-classes.union ;
+classes.maybe ;
 IN: slots
 
 TUPLE: slot-spec name offset class initial read-only ;
index 5efd0d8014f870c78ddce31bb58a1e9031ee8c13..b4c2c5b065818bf84975bd98a25afff4c55f1591 100644 (file)
@@ -7,7 +7,7 @@ words.alias quotations io assocs splitting classes.tuple
 generic.standard generic.hook generic.math generic.parser classes
 io.pathnames vocabs vocabs.parser classes.parser classes.union
 classes.intersection classes.mixin classes.predicate
-classes.singleton classes.tuple.parser compiler.units
+classes.singleton classes.tuple.parser compiler.units classes.maybe
 combinators effects.parser slots hash-sets source-files ;
 IN: bootstrap.syntax