
Bill Clementson's Blog: JavaScript and Lisp - r11t
http://bc.tech.coop/blog/030920.html
======
TNO
Using JavaScript 1.8 expression closures:

    
    
      function Y(X)
          (function(procedure)
              X(function(arg) procedure(procedure)(arg)))
                  (function(procedure)
                      X(function(arg) procedure(procedure)(arg)))

------
jdeseno
Nice but, anonymous recursion is possible with arguments.callee.

~~~
benatkin
More on arguments.callee:

[https://developer.mozilla.org/En/Core_JavaScript_1.5_Referen...](https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments/callee)

------
owinebarger
Tried Doug Crockford's little Javascripter: (define loop (lambda (x) (loop
x))) (loop 1)

Result in Firefox: "Too much recursion"

I'm still surprised I didn't flunk B521 when Dan Friedman put something like
this in my Java implementation of a Scheme interpreter and it blew up after
some finite number of iterations.

It might have worked if method calls were properly tail-recursive!

------
hypermatt
Helped me find a cool video from this Waldemar Horwat guy.
<http://www.youtube.com/watch?v=Kq4FpMe6cRs>

------
andrewcooke
> _will recognize that functions in JScript are fundamentally the Lambda
> Calculus_

i would have thought you could say that about functions in any language...

~~~
mahmud
Except languages where you can't pass functions as arguments or return them as
results.

~~~
swannodette
Horror! I didn't know such atrocities existed _shudder_ ;)

------
vlisivka
JavaScript is implementation of Scheme (dialect of Lisp) with Java-like
syntax.

~~~
swannodette
Or as I like to say "JavaScript is Scheme in C drag".

