Skip to content

Instantly share code, notes, and snippets.

@marcoonroad
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoonroad/73956d2e559aab373070 to your computer and use it in GitHub Desktop.
Save marcoonroad/73956d2e559aab373070 to your computer and use it in GitHub Desktop.
Perl 6 power over Fibonacci sequence.
#!/usr/bin/perl6
use v6;
my @fib := ^2, *+* ... *; # lazy list with fibonacci sequence under memoization
sleep +(.say) for @fib;
# foreach @fib get a $value, so print this $value, then cast the Bool result of say (True)
# into a Integer, now you can pass this Integer (1) for a sleep (delay $x seconds) function...
#-----------------------------------#
# ^2 |===> Non-structured.Array #
# *+* |===> Declarative.Functional #
# := |===> Declarative.Logic #
# .say |===> Structured.OOP #
# $_ |===> Point-free | Tacit #
#-----------------------------------#
# end of script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment