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

Is this implementation multishot? #18

Open
kyay10 opened this issue Jun 3, 2024 · 1 comment
Open

Is this implementation multishot? #18

kyay10 opened this issue Jun 3, 2024 · 1 comment

Comments

@kyay10
Copy link

kyay10 commented Jun 3, 2024

Hello, I'm working on implementing delimited continuations for Kotlin, which has the option of compiling to JS.
Your implementation is intriguing, but I can't figure out from reading the code alone if it supports multishot behaviour (i.e could I do k(k(k(5))) where k is the cont passed to shift and it'd work just fine?)

This should likely be clarified in the README!

@cowboyd
Copy link
Member

cowboyd commented Jun 3, 2024

Hi @kyay10, and thanks for your interest! In this library, the k() captured by shift() is a single shot continuation. It will continue to return the same value that it did the first time, or if it raises an error, will continue to raise the same error that was raised the first time it was evaluated.

We can definitely update the README

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

2 participants