JuliaDynamics / ResumableFunctions.jl

C# style generators a.k.a. semi-coroutines for Julia.
Other
158 stars 19 forks source link

Recognizable names of iterator types #39

Closed baggepinnen closed 1 year ago

baggepinnen commented 4 years ago

Hi, I'm enjoying this package quite a lot! I do have one issue though, and would like to see if there might be a solution for it.

The iterable types created by a call to a @resumable function have anonymous names, e.g.,

MyPackage.var"##403"(0x00, #undef,T}

It would be great if the name var"##403" at least contained the function name as specified here

@resumable function my_fun()
...

so that one could easier navigate stack traces etc.

Better yet, if it was possible to dispatch on the generated type, so I could do something like

other_function(iterator::MyResubableFunction) = ...

Any thoughts on if this would be possible?

BenLauwens commented 4 years ago

Hi

Sorry for the late reply. Nice idea. I will put it on my todo list;) Kind regards

Ben