On Wed, Feb 20, 2013 at 11:08 AM, William Tanksley, Jr <[email protected]> wrote: > Raul Miller <[email protected]> wrote: >> A "closure" is a reference to a subroutine combined with a reference >> to an environment which provides mutable definitions for the free >> variables (names whose definitions are supplied outside the body of >> the subroutine) referenced from that subroutine. > > That's a good definition, except for the word "mutable". Wouldn't the > mutability of the definitions depend on factors other than whether or > not they are provided by the closure? > > Remove that word, and your definition definitely stands.
Without mutability there's no need for the environment and you cannot tell whether or not an environment is present - the values referenced can be incorporated directly into the function. In other words, you can call that case a closure with an added constraint that some part of the environment is frozen. But if the environment guaranteed to be not mutable you can not distinguish between references and values, and the environment need not exist. That's a trivial case. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
