Multiton: Difference between revisions
Content added Content deleted
m (→{{header|Raku}}: simplify) |
m (→{{header|Raku}}: simplify) |
||
Line 133: | Line 133: | ||
class Multiton { |
class Multiton { |
||
my %instances = MultitonType.keys Z=> $ ⚛= 1 xx |
my %instances = MultitonType.keys Z=> $ ⚛= 1 xx * ; |
||
has $.type is rw; |
has $.type is rw; |
||
method TWEAK { |
method TWEAK { $.type = 'Nothing' unless cas(%instances{$.type}, 1, 0) } |
||
} |
} |
||