[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Self-awareness of functions?
- From: Dirk Laurie <dpl@...>
- Date: Thu, 30 Dec 2010 23:27:35 +0200
On Thu, Dec 30, 2010 at 10:37:41PM +0200, jgiors@threeeyessoftware.com wrote:
> What Steve wrote had a typo (missing keyword "then"), but was
> otherwise correct. It should have been this:
>
> local fact
> function fact(n)
> if n == 2 then return 2 else return n*fact(n-1) end
> end
>
Alas, no. Try that code for n=0 and n=1.
The rest of your post deals with things that others have already
responded to.
Dirk