Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

proof that lisp is a toy language

Name: Anonymous 2007-10-25 9:25

it can't even do this:
function fib(n){
 return (function(i){
   return i==1?0:arguments.callee(i-1)+(function(i){
    return i==1?1:arguments.callee.caller(i-1)
   })(i-1)
  })(n+1)
}

Name: Anonymous 2007-10-25 10:26

>>1
Correct you can't do that in lisp, there is no arguments, or arguments.callee or arguments.callee.caller

You can do this though:

(defmacro define-javascript-style-function (...)
 `(defun ... (arguments arguments.callee arguments.callee.caller ...) ...))

(defmacro call-javascript-style-function (funk args)
 `(apply funk <caller> ... args))

To acheive the same effect.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List