Self-recursion and arrow functions

Axel Rauschmayer axel at
Sun Mar 17 12:11:54 PDT 2013

Nice (in an IIFE-kind of way). If we had `do` expressions, the following would also be possible (producing an expression that could be assigned anywhere and to anything):

    do {let fact = n=>n>1 ?n*fact(n-1):1}

I’m assuming that the completion value of a let declaration is the rhs of the last assignment. Otherwise, `; fact` would have to be appended.

On Mar 17, 2013, at 19:24 , Allen Wirfs-Brock <allen at> wrote:

> I don't think anybody has yet exploited the power of parameter default values for defining recursive functions:
>    ((fact=n=>n>1 ?n*fact(n-1):1)=>(fact))()

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list