Skip to content

Instantly share code, notes, and snippets.

@synthmeat

synthmeat/LAST Secret

Created April 14, 2020 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save synthmeat/413e372941a39244713e9c153ee379da to your computer and use it in GitHub Desktop.
Save synthmeat/413e372941a39244713e9c153ee379da to your computer and use it in GitHub Desktop.
loop {
state $n = 0;
put $n++;
last if $n > 2;
LAST { put $n }
}
# 0
# 1
# 2
# 3
sub MAIN () {
loop {
state $n = 0;
put $n++;
last if $n > 2;
LAST { put $n }
}
}
# Use of uninitialized value $n of type Any in string context.
# Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
# in block at exercise.raku line 8
#
# 0
# 1
# 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment