Re: Lexical variables, scratchpads, closures, ...
by Jerome Vouillon other posts by this author
Aug 4 2002 4:24PM messages near this date
Re: Lexical variables, scratchpads, closures, ...
|
Re: Lexical variables, scratchpads, closures, ...
On Sat, Aug 03, 2002 at 01:42:06AM -0400, Melvin Smith wrote:
> Here is an attempt. I'm assuming the stack of pads is a singly-linked list
> of pads with children pointing to parents, and multiple children can refer
> to the same parent. If they are created on the fly, the creation of
> a Sub or Closure will simply hold a pointer to its parent, and pads will
> be garbage collected.
This should work. I think you still need a "real" stack of pads. The
opcode "new_pad" creates a new pad whose parent is the top of the
stack, and replace this parent by the new pad in the stack. The opcode
"invoke" push the subrouting pad onto the stack. The opcode "ret" pop
the top of the stack.
-- Jerome
Thread:
Jerome Vouillon
Melvin Smith
Jerome Vouillon
Sean O'Rourke
Jerome Vouillon
Dan Sugalski
Dan Sugalski
Simon Cozens
Nicholas Clark
Sean O'Rourke
Jerome Vouillon
Nicholas Clark
Jerome Vouillon
Jonathan Sillito
Dave Mitchell
Melvin Smith
Sean O'Rourke
Dan Sugalski
Dan Sugalski
Jonathan Sillito
Jerome Vouillon
Melvin Smith
Jerome Vouillon
Melvin Smith
Jerome Vouillon
Jonathan Sillito
Sean O'Rourke
|