Allen Wirfs-Brock wrote:
With "body-swap" it concerns me a bit that is an arbitrary and
variable number of closures may need to be updated each iteration
(consider a body containing a while loop that spits out closures that
capture init bindings.)

I think there are some lazy possibilities for that. Create the "copy" beforehand by sort-of Object.create(loopContext) then either use the "transparent proxy to loopContext while running / iterEnd: populate copy with let-vars / proxy become: copy" (pity there probably is not #become: (or #forwardBecome:) in vm) or "store copy to @wouldBeCopy in loopContext / closure-created: store copy to [[ContextForDetachment]] in closure / use actual record (loop-context) since actual-record-to-use.@wouldBeCopy === [[ContextForDetachment]] / iterEnd: populate copy with let-vars && loopContext.@wouldBeCopy = null (later different object in subsequent iterations) / in detached closure, lazily do actual-context-to-use = [[ContextForDetachment]] since actual-record-to-use.@wouldBeCopy exists and is different from [[ContextForDetachment]]".

Implementors can probably find better ones.

Allen

Herby
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to