MakeDo Safe

I have just now (2016) realized that Marc Stiegler’s 5 year old construct for E (search for “authority amplification”), which I knew of at the time, is suitable for Scheme and probably several other languages. It thus largely removes the need for my proposed Scheme primitive. There might remain a small performance advantage for my proposal.

I implement here the proposed primitive with standard scheme primitives. I have introduced a new Scheme module for synergy in my module system here. In the code below “Seal” is bound to the value of:

(lambda () (let ((thePayload '()) (hasPayload #f))
  (cons (lambda (payload) (lambda () (set! thePayload payload) (set! hasPayload #t)))
        (lambda (box) (set! hasPayload #f) (box) (if hasPayload thePayload #f)))))
Just now I begin to worry about not throwing an exception upon false box. I need that even for my HSet application! http://blog.gmane.org/gmane.comp.capabilities.general/month=20110401 CapTheory/Synergy/E.html