Skip to content

Instantly share code, notes, and snippets.

@hayeah
Created August 11, 2010 19:02
Show Gist options
  • Save hayeah/519534 to your computer and use it in GitHub Desktop.
Save hayeah/519534 to your computer and use it in GitHub Desktop.
flet do
def fact(i)
return 1 if i == 1
i * fact(i-1)
end
def fib(i)
return 1 if i == 0
return 1 if i == 1
fib(i-1) + fib(i-2)
end
[fact(10),fib(7)]
end
def flet(&block)
mod = Module.new
mod.extend(mod)
mod.module_eval(&block)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment