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 <[email protected]> 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
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss