James Coglan
3/20/2009 12:19:00 PM
[Note: parts of this message were removed to make it a legal post.]
2009/3/20 Brian Adkins <lojicdotcom@gmail.com>
> James Coglan <jcoglan@googlemail.com> writes:
>
> > [Note: parts of this message were removed to make it a legal post.]
> >
> > 2009/3/20 Leo <minilith@gmail.com>
> >
> >> > Can someone explain why the nested method hides the outer method?
> >>
> >> There are no nested methods in ruby (similar to smalltalk, eiffel,
> >> java and unlike scheme, python etc.).
> >
> >
> > This statement could confuse people given the above. Clearly you can
> define
> > methods inside other methods, the point is that the 'inner' method is not
> > local to the outer one. The inner one becomes defined in the same scope
> as
> > the outer one,
>
> Isn't being defined in the same scope the antithesis of nesting?
>
> > and does not remember the environment it was created in.
> > Methods are not closures, unlike blocks/procs/lambdas.
>
Depends what you mean by nesting, which was supposed to be my point -- that
the methods are lexically nested but not dynamically nested. In other words
their lexical nesting does not imply lexical scope or closures in this case.