On Fri, May 1, 2015 at 11:15 AM, Jonathan S. Shapiro <s...@eros-os.org> wrote: > 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?
In general i would be for LETREC as I view it as a one time overhead on function declaration, but it tells many times whenever we need to look at the declaration that this is a strongly connected component.. that is letrec is good for forward references, let is good for back references, I would be happy with a mechanism for non-references as well, because let doesn't do a good job of specifying if something is declared after something else because it requires a backreference, or simply because it's declared after. _______________________________________________ bitc-dev mailing list bitc-dev@coyotos.org http://www.coyotos.org/mailman/listinfo/bitc-dev