Created
April 26, 2019 08:44
-
-
Save taboege/500b3c4c3dc64668e2fe5f09699c7ead to your computer and use it in GitHub Desktop.
ENTER $H<> sometimes empty?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
has $.x; | |
method WHICH { | |
ValueObjAt.new: "A|$!x.WHICH()" | |
} | |
} | |
# Whose images we collect. | |
my @G = A.new(x => 1); | |
my Set $H; | |
loop { | |
$H ∪= @G; | |
last if $H<> eqv ENTER $H<>; | |
# If this line is commented in (to prevent the infinite loop), | |
# it suddenly works as expected, ENTER $H<> is not a Set type object | |
# and the loop finishes before $ reaches 20. | |
#last if $++ > 20; | |
# Prints (Set) infinitely? | |
say (ENTER $H<>); | |
@G .= map: { A.new(x => (.x + 1) % 13) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment