[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clarification on named let
I was not happy with "bindrec", but I didn't put my finger on why until
I read your most recent note (which I found very clear and to the point).
I don't like "bindrec" because the suffix "rec" doesn't mean what it
does in "letrec". Letrec differs from let in a matter of scope only,
in that the variables to be bound are made available in parts of
the program text that would otherwise be surprising, because they
are executed before the variables are really available. Bindrec,
on the other hand, provides an ADDITIONAL name for an additional
entity, and I regard it as secondary that this name has a rec-type
I might be happier if there were a "bind" just like bindrec, which also
gives a name to the function but not a rec-bound name. Such a form would
of course be useless, but that's the price of symmetry. My point is that
I believe the issue has been confused up to now because there are
separarable notions here that have been conceptually mingled because the
suffix "rec" was used to mean two different things.
It may be worthwhile to ponder whether a named letrec makes sense.
I think so, and in that case we need a name for that idea too.
Then clearly named let should not be called bindrec, for then
named letrec would be bindrecrec (more yuk).
How about letfn (and letfnrec)?