And the function itself needs to either not have a name or be local. Otherwise, you are creating one generic function and just changing the dispatch for () On Mon, Feb 16, 2015 at 1:27 PM Stepa Solntsev <[email protected]> wrote:
> I tried, it still doesn't work. > > function nice() > i=1 > while true > let j=i > f() = j > produce(f) > end > > i+=1 > end > end > ye = Task(() -> nice()) > funcs = Function[] > for k in [1:2] > push!(funcs,consume(ye)) > end > > println(funcs[1]()) > println(funcs[2]()) >
