Created
          August 11, 2010 19:02 
        
      - 
      
- 
        Save hayeah/519534 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | 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