cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Feature Request: Mutual Recursion

SOLVED

Re: Feature Request: Mutual Recursion

Werner Exinger wrote:

I haven't used Prime for quite some time and not that I would care, but as far as I remember, a definition like c<--abc("c") will not work in Prime.

You're right; partial function application no longer works. 😞

However, my workaround for it does (as one would expect).

The If-Elseif-Else structure is very good at taking up vertical space on the worksheet.  I find it harder to make sense of such extended programs, so I used if functions instead of if statements.

There's another form that's amenable to your method, and that is to use a generic function.

Stuart

Re: Feature Request: Mutual Recursion

Nice little challenge.  F(0) through F(n-1) have to know to calculate F(n), same with M(n).  M(n) can be calculated before F(n), provided F(0) through F(n-1) are known.  See attached code and check my logic.

HofstadterChallenge.jpg

Cheers

Re: Feature Request: Mutual Recursion

David Tietje wrote:

Nice little challenge.  F(0) through F(n-1) have to know to calculate F(n), same with M(n).  M(n) can be calculated before F(n), provided F(0) through F(n-1) are known. 

HofstadterChallenge.jpg

Cheers

It seems to work ... see attached worksheet.

See attached code and check my logic.

I tried to but now

Stuart

Announcements