-
Notifications
You must be signed in to change notification settings - Fork 17
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
Generic continuations #93
Comments
For the most part we need to clone |
@zevv isn't going to wait around for generics, I guess. |
After a bit of a think I realized that this has probably not the highest prio, and/or we could (should) even do without them; thus the premature closing |
More thinking, and I can't make up my mind. I think we do need generics after all :) |
This already works:
This is the fully generic version that exposes the above two problems, and does not compile:
|
As discussed on IRC, the verdict on this is that we have to be able to work on the instantiated tree as the generics tree is basically untyped. |
I dont know if it is related or i need to create another issue. I found that generic proc arguments cannot be lifted in continuation. for example proc a(n: int | float) {.cps: Continuation.} =
echo n and this not compiling of course i can make compiler work myself type C = Continuation
template aImpl() {.dirty.} =
echo n
proc a(n: int) {.cps: C} =
aImpl()
proc a(n: float) {.cps: C} =
aImpl() but is it the most convenient way? |
It's the same issue. As of today the problem remains the same, we don't have a good way to only work on an instantiated Nim tree. |
What would be needed to get generic continuations like in
stash/iteratorT.nim
to work?The text was updated successfully, but these errors were encountered: