Loading ...
Sorry, an error occurred while loading the content.

Re: [sicp-vsg] Frames

Expand Messages
  • John Berthels
    ... I ve confused myself a little here. A lambda creates a procedure which includes a reference to the enclosing environment, i.e. to the frame created for the
    Message 1 of 3 , Jun 27, 2005
    • 0 Attachment
      I wrote earlier:

      > This is also a nice way to think about lambda. A lambda creates a
      > procedure, which includes a frame. This allows us to save a reference
      > to the procedure, and hence the frame, hence the frame persists.

      I've confused myself a little here. A lambda creates a procedure which
      includes a reference to the enclosing environment, i.e. to the frame
      created for the procedure invocation in which the lambda is running.

      Rule 1: lambda creates a procedure (which is code+environment)
      Rule 2: procedure application creates a new frame (binding the args
      for this application) which chains to the procedure's environment.

      So...a frame is associated with a procedure invocation. It will only
      persist once the procedure returns if a reference to the frame is
      captured. Which is pretty much iff a lambda is executed in the
      procedure body and that lambda value leaves the procedure, either as
      the return value or by being set! into another variable.

      jb
      --
      john@...
    Your message has been successfully submitted and would be delivered to recipients shortly.