Skip to content

Instantly share code, notes, and snippets.

@dmitriy-kiriyenko
Forked from xentatt/gist:5574047
Last active December 17, 2015 07:39
Show Gist options
  • Save dmitriy-kiriyenko/5574061 to your computer and use it in GitHub Desktop.
Save dmitriy-kiriyenko/5574061 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def multifunc(msg, pos, b)
b.call(pos)
end
multifunc("Fibonacci numb", 10, f = lambda { |n| (n == 0 || n == 1) ? n : (f.call(n-1) + f.call(n-2)) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment