[Python-Dev] 'stackless' python?

Jeremy Hylton jeremy at cnri.reston.va.us
Thu May 20 21:26:30 CEST 1999


>>>>> "CT" == Christian Tismer <tismer at appliedbiometrics.com> writes:

  CT> What I want to achieve is that I can run this again, from my
  CT> snapshot. But with shared locals, my parameter x of the snapshot
  CT> would have changed to x+1, which I don't find useful.  I want to
  CT> fix a state of the current frame and still think it should "own"
  CT> its locals. Globals are borrowed, anyway.  Class instances will
  CT> anyway do what you want, since the local "self" is a mutable
  CT> object.

  CT> How do you want to keep computations independent when locals are
  CT> shared? For me it's just easier to implement and also to think
  CT> with the shallow copy.  Otherwise, where is my private place?
  CT> Open for becoming convinced, of course :-)

I think you're making things a lot more complicated by trying to
instantiate new variable bindings for locals every time you create a
continuation.  Can you give an example of why that would be helpful?
(Ok.  I'm not sure I can offer a good example of why it would be
helpful to share them, but it makes intuitive sense to me.)

The call_cc mechanism is going to let you capture the current
continuation, save it somewhere, and call on it again as often as you
like.  Would you get a fresh locals each time you used it?  or just
the first time?  If only the first time, it doesn't seem that you've
gained a whole lot.

Also, all the locals that are references to mutable objects are
already effectively shared.  So it's only a few oddballs like ints
that are an issue.

Jeremy




More information about the Python-Dev mailing list