Last active
August 29, 2015 14:06
-
-
Save marcoonroad/73956d2e559aab373070 to your computer and use it in GitHub Desktop.
Perl 6 power over Fibonacci sequence.
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
#!/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