Multiton: Difference between revisions

m
m (→‎{{header|Raku}}: simplify)
Line 133:
class Multiton {
 
my %instances = MultitonType.keys Z=> $ ⚛= 01 xx MultitonType.keys.elems;
 
has $.type is rw;
 
method TWEAK { self.type = 'Nothing' unless cas(%instances{self.type}, 1, 0) }
⚛%instances{self.type} == 1 ?? ( self.type = 'Nothing' )
!! cas(%instances{self.type}, 0, 1)
}
}
 
350

edits