Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react/suspend should be implemented with stop-facet #28

Open
tonyg opened this issue Sep 13, 2017 · 0 comments
Open

react/suspend should be implemented with stop-facet #28

tonyg opened this issue Sep 13, 2017 · 0 comments

Comments

@tonyg
Copy link
Owner

tonyg commented Sep 13, 2017

At present, there is a lot of special-purpose machinery around react/suspend to schedule the suspended continuation when it is invoked, ensure termination of the created facet, prevent multiple invocations of the continuation (!!?!?!) etc. I think it might be a lot simpler if instead we implemented it so that invoking the wrapped continuation just calls stop-facet on the created facet, with a call to the raw continuation inside the stop-facet. That should Do The Right Thing, given that stop-facet already transplants execution to the parent of the facet-being-terminated.

Something like this:

E[(react/suspend (k) P)] ==>
(let ((the-facet (current-facet-id)))
  (react (let ((k (lambda (v) (stop-facet the-facet E[v])))) P)))

The until macro would need to be adjusted to match, to say (on E (continue (void))) instead of the current (stop-when E (continue (void))).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant