Mutually recursive functions

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
pakin
Posts: 43
Joined: Sat Apr 21, 2007 8:59 pm
Location: United States
Contact:

Mutually recursive functions

Post 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)) 

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Mutually recursive functions

Post by MtnViewJohn »

Mutual recursion is not supported. I suppose that it could be supported.

Post Reply