There are three ways we can handle mutual recursion in BitC. One is to declare (as a matter of design) that mutually recursive functions must be co-defined within a common LETREC. The other is to take the view that all top-level function definitions within a single unit of compilation are understood to occur within a LETREC over the entire compilation unit (which implies that functions may engage in forward-reference). The third option is to allow forward declarations within a unit of compilation (as BitC v0 did), which can be thought of as a compromise in which everything in a unit of compilation is logically defined in a UoC-granularity LETREC but we add an additional syntactic requirement (the declaration) both to ease the problem for type inference and to avert *unintentional* forward reference.
I am completely comfortable to disallow [static] mutual recursion across module boundaries, because codependent modules aren't a good thing. I'm less sanguine about requiring mutually recursive definitions to be defined in a common [explicit] LETREC. Opinions? Jonathan
_______________________________________________ bitc-dev mailing list bitc-dev@coyotos.org http://www.coyotos.org/mailman/listinfo/bitc-dev