Last active
December 19, 2015 20:18
-
-
Save bakkdoor/6012154 to your computer and use it in GitHub Desktop.
Fancy<->Ruby interop
This file contains hidden or 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 Integer { | |
def fib { | |
match self { | |
case @{ < 2 } -> self | |
case _ -> self - 1 fib + (self - 2 fib) | |
} | |
} | |
} |
This file contains hidden or 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
0.upto(10) do |i| | |
# call into ruby via .fy method and pass along fancy message name | |
puts i.fy(:fib) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment