Michael Bevilacqua-Linn on 15 Mar 2010 15:28:20 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: closures


>It doesn't seem to me that nested procedure definitions are strictly necessary
to create a closure - so long as a function is created whose variables are bound
according to the scope at the time of creation.

Yeah that particular syntax was just for the sake of illustration.  Generally, you'd have some way of creating an anonymous procedure, that you can then pass around as needed. 

>... even after that original scope is gone, e.g. if a reference was passed out
of "outerProcedure" and lives on afterward.

Yep, should have mentioned that.

[SNIP]

  • Follow-Ups:
  • References:
    • closures
      • From: "Mark M. Hoffman" <mhoffman@lightlink.com>
    • Re: closures
      • From: mjd-phillylambda@plover.com
    • Re: closures
      • From: Michael Bevilacqua-Linn <michael.bevilacqualinn@gmail.com>
    • Re: closures
      • From: "Mark M. Hoffman" <mhoffman@lightlink.com>