lua-users home
lua-l archive

Re: Weird line breaks (was Recursive Anonymous Functions)

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
Is it only me, or are there other people receiving some messages with weird/no line breaks?
Regards,
Diego
On Wed, 1 Aug 2007, gary ng wrote:
Do you mean the Y combinator ?
http://en.wikipedia.org/wiki/Y_combinator
--- Patrick Donnelly <batrick@hotmail.com> wrote:
I know this has been talked about before, and I read
all the posts in the archive on this. There wasn't
an "accepted" method for going about it, so I
wondered if this implementation is optimal:function
execute(func, ...) return func(...);end;function
test(s) return execute(function(f) local fact;
 fact = function(n, ret) ret = ret or 1;
if n == 0 then return 1 * ret end; return
fact(n - 1, n * ret); end; return fact(f);
end, s);end;test(3) --> 6Comments?-Patrick Donnelly
"One of the lessons of history is that nothing is
often a good thing to do and always a clever thing
to say."
-Will Durant

AltStyle によって変換されたページ (->オリジナル) /