Page 1 of 1

Mutually recursive functions

Posted: Fri Mar 02, 2012 12:34 am
by pakin
Does CF3 support mutually recursive functions? Some code I'm writing gives me either a

Code: Select all

User functions must have numeric type only
or a

Code: Select all

select()/if() choices must be of same type
error, and I'm wondering if my problem is mutual recursion or something else I'm doing wrong.

Here's a small reproducer:

Code: Select all

startshape placeholder

shape placeholder { SQUARE [] }

foo(a_) = if(a_ == 0, a_, baz(a_ - 1))
baz(a_) = if(a_ == 0, a_, foo(a_ - 1)) 

Re: Mutually recursive functions

Posted: Fri Mar 02, 2012 1:02 am
by MtnViewJohn
Mutual recursion is not supported. I suppose that it could be supported.