-
Notifications
You must be signed in to change notification settings - Fork 21
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
UX: auto-transform captured seq to ptr UncheckedArray behind the scenes #179
Comments
To me this doesn't seem as boilerplate at all (actually making it explicit is definitely a good thing!). It seems to be rather a performance & safety problem (GC). |
I don't think this is really an issue. It's essentially a "bug" that one cannot just pass a regular seq (I put that into quotation marks, as I don't fully understand where the problems come from). Hiding the required transformation from the user seems nice. Especially, because it is a fully mechanical transformation. However, there is a practical issue implementing this as far as I can tell:
parallelFor upper in 0 ..< height:
captures: {width, @distance, @dataset}
# ... which seems reasonable, given that I don't see why someone would hand some identifier that is supposed to be turned into a sequence in the context of |
We don't want to go that path but we can always have the untyped macro The @ would be nice also to indicate transformation of a |
having to
cast[ptr UncheckedArray[T]]
any capturedseq[T]
before use is a lot of boilerplate and quite annoying.Example from Discord:
The text was updated successfully, but these errors were encountered: