[Tutor] nested function definition

Norvell Spearman norvell@houseofspearman.org
Tue Apr 29 10:05:07 2003

On Tuesday, 2003.04.29, 10:39:18 +0200, Kristoffer Erlandsson wrote:
> The most obvious uses for this is to define small "fire and forget" functions
> that you use once inside an other function.
> The advantages of this is that if you need a function somewhere (for example as
> argument to an other function) you can easily define it locally, use it and
> forget about it and you don't have to clutter the global namespace. The
> disadvantage (if you can call it that) is that the function isn't usable or
> visible outside the enclosing function.

Does this also mean that garbage collection will take out a
locally-defined function earlier than a globally-defined one?

Norvell Spearman