Currently the Gonum graph packages make use of go:linkname abuse to be
able to implement first class iterator values that can be passed. We
also have a reflect-based implementation, but this incurs a significant
performance cost and so cannot be used as the default implementation
(users are able to select this through build tags).

With the advent of function iterators it would (superficially) appear
that there would be a path towards making this kind of iterator value
more generally available. This currently does not work (for example
here: https://go.dev/play/p/yb-c7f_E7t3
and https://go.dev/play/p/T3lbn-XrnYd, both of which are surprising
from a the perspective of a pre-rangefunc Go user). This is not the
case with map iterators since there is no corresponding index that is
meaningful in that context, but this is a matter of runtime
implementation.

Is there any chance that something like this would be supported in the
future?

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d0b3bffaff27f7d3b501b1f2d327eb94e95d0829.camel%40kortschak.io.

Reply via email to