Advertisement
Gallefray

Untitled

Jun 16th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.39 KB | None | 0 0
  1. (def + (lua "function (x, y) return x + y end"))
  2. (def - (lua "function (x, y) return x - y end"))
  3. (def < (lua "function (x, y) return x < y end"))
  4. (def fib-rec (lambda (n)
  5.   (if (< n 2)
  6.       n
  7.       (+ (fib-rec (- n 1))
  8.          (fib-rec (- n 2))))))
  9.  
  10.  
  11. (def time (lambda (n) (...
  12.   (def t (lua "os.clock()"))
  13.   (fib-rec n)
  14.   (def t1 (lua "os.clock()"))
  15.   (- t1 t))))
  16.  
  17. (time (fib-rec 30)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement