]> gitweb.factorcode.org Git - factor.git/commitdiff
classes.maybe: this restriction isn't necessary anymore.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 Apr 2016 21:20:00 +0000 (14:20 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 Apr 2016 21:20:00 +0000 (14:20 -0700)
core/classes/maybe/maybe-tests.factor
core/classes/maybe/maybe.factor

index fa266088338bfa0181f159e3dd21e617be5222bc..846680255797540f1aa8800ce1f9565ae8eb993a 100644 (file)
@@ -62,8 +62,5 @@ M: f lol2 drop "lol22" ;
 { "lol22" } [ f lol2 ] unit-test
 [ 3 lol2 ] [ no-method? ] must-fail-with
 
-{ t } [ \ + <maybe> classoid? ] unit-test
-{ f } [ \ + <maybe> valid-classoid? ] unit-test
-
 [ "IN: classes-tests maybe{ 1 2 3 }" eval( -- ) ]
 [ error>> not-classoids? ] must-fail-with
index 9c89e368f7ea71d0373d692c5bf33e4685210047..451b0513a88f4db361cc45656e76555dd040863c 100644 (file)
@@ -5,13 +5,7 @@ classes.algebra.private classes.private classes.union.private
 kernel words ;
 IN: classes.maybe
 
-! The class slot has to be a union of a word and a classoid
-! for TUPLE: foo { a maybe{ foo } } ; and maybe{ union{ integer float } }
-! to work.
-! In the first case, foo is not yet a tuple-class when maybe{ is reached,
-! thus it's not a classoid yet. union{ is a classoid, so the second case works.
-! words are not generally classoids, so classoid alone is insufficient.
-TUPLE: maybe { class union{ word classoid } initial: object read-only } ;
+TUPLE: maybe { class classoid initial: object read-only } ;
 
 C: <maybe> maybe