ResumableFunctions.jl
ResumableFunctions.jl copied to clipboard
C# style generators a.k.a. semi-coroutines for Julia.
I wanted a macro that takes a sub-generator and yields its elements. I wrote this: ``` macro yieldmany(resumable::Expr) return quote for x in $(esc(resumable)) @yield x end end end ```...
I'm running into some issues using this package alongside another macro-based package, ProgressLogging.jl My goal is to add optional progress bars to a package which uses ResumableFunctions.jl, the original function...
What causes this error? I am trying to interrupt a process in SimJulia using `SimJulia.interrupt` ```julia ERROR: @resumable function has stopped! Stacktrace: [1] error(::String) at .\error.jl:33 [2] (::ProcessSim.var"##312")(::Nothing) at C:\Users\HD\.julia\packages\ResumableFunctions\n1hTu\src\macro.jl:88...
Doing this: ``` """ filenames(...) docstring """ @resumable function filenames(...) ... end ``` throws an error, error being: ``` cannot document the following expression: #= /home/siddharth/.julia/dev/CCDReduction.jl/src/collection.jl:105 =# @resumable function filenames(df::DataFrame)...
In Python the `yield from` syntax described in [PEP 380](https://www.python.org/dev/peps/pep-0380/) allows a generator to delegate to a subgenerator, with the subgenerator then able to yield to the caller of the...
CodeCov misses `@resumable` functions even if they have proper tests written. Related PR: https://github.com/JuliaAstro/CCDReduction.jl/pull/27 PS: I don't know whether I should have opened an issue here or in source repositories...
It would be convenient if was possible to supply the length of a resumable function if the length is known. A lot of functions around the ecosystem do not work...
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...
The following ``` @resumable function my_generator() x = 0 @yield (x = 1, ) end ``` fails with ``` ERROR: LoadError: syntax: invalid named tuple field name "_fsmi.x" ``` No...
on ResumableFunctions 0.1.10 and julia 0.6.2 ```julia using ResumableFunctions @resumable function gen(n) for i=1:n, j=1:n @yield i end end collect(gen(10)) ``` gives ``` ERROR: UndefVarError: #temp# not defined Stacktrace: [1]...