Skip to content

Instantly share code, notes, and snippets.

@bakkdoor
Last active December 19, 2015 20:18
Show Gist options
  • Save bakkdoor/6012154 to your computer and use it in GitHub Desktop.
Save bakkdoor/6012154 to your computer and use it in GitHub Desktop.
Fancy<->Ruby interop
class Integer {
def fib {
match self {
case @{ < 2 } -> self
case _ -> self - 1 fib + (self - 2 fib)
}
}
}
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