TUPLE: tuning-spork <{ utensil spoon tuning-fork } ;
! role class testing
-{ t } [ fork role? ] unit-test
-{ f } [ foon role? ] unit-test
+[ t ] [ fork role? ] unit-test
+[ f ] [ foon role? ] unit-test
! roles aren't tuple classes by themselves and can't be instantiated
-{ f } [ fork tuple-class? ] unit-test
+[ f ] [ fork tuple-class? ] unit-test
[ fork new ] must-fail
! tuples which consume roles fall under their class
-{ t } [ foon new fork? ] unit-test
-{ t } [ foon new spoon? ] unit-test
-{ f } [ foon new tuning-fork? ] unit-test
-{ f } [ foon new instrument? ] unit-test
+[ t ] [ foon new fork? ] unit-test
+[ t ] [ foon new spoon? ] unit-test
+[ f ] [ foon new tuning-fork? ] unit-test
+[ f ] [ foon new instrument? ] unit-test
-{ t } [ tuning-spork new fork? ] unit-test
-{ t } [ tuning-spork new spoon? ] unit-test
-{ t } [ tuning-spork new tuning-fork? ] unit-test
-{ t } [ tuning-spork new instrument? ] unit-test
+[ t ] [ tuning-spork new fork? ] unit-test
+[ t ] [ tuning-spork new spoon? ] unit-test
+[ t ] [ tuning-spork new tuning-fork? ] unit-test
+[ t ] [ tuning-spork new instrument? ] unit-test
! consumed role slots are placed in tuples in order
-{ qw{ handle tines bowl } } [ foon all-slots [ name>> ] map ] unit-test
-{ qw{ handle bowl tines tone volume } } [ tuning-spork all-slots [ name>> ] map ] unit-test
+[ qw{ handle tines bowl } ] [ foon all-slots [ name>> ] map ] unit-test
+[ qw{ handle bowl tines tone volume } ] [ tuning-spork all-slots [ name>> ] map ] unit-test
! can't combine roles whose slots overlap
ROLE: bong bowl ;
M: spoon scoop drop " got scooped" append ;
M: instrument tune drop " got tuned" append ;
-{ "potato got poked" "potato got scooped" "potato got tuned" }
+[ "potato got poked" "potato got scooped" "potato got tuned" ]
[ "potato" tuning-spork new [ poke ] [ scoop ] [ tune ] 2tri ] unit-test