Coder Social home page Coder Social logo

Comments (5)

BenLauwens avatar BenLauwens commented on June 4, 2024 1

Hi

I tested your interleave example and it seems fine. So I will release a new version of ResumableFunctions, so that you can update your blog;)
Regards

Ben

from resumablefunctions.jl.

oxinabox avatar oxinabox commented on June 4, 2024

I wanted to include this as an example in:
http://white.ucc.asn.au/2017/11/18/Lazy-Sequences-in-Julia.html

I can still go back an add it later of-course.

from resumablefunctions.jl.

oxinabox avatar oxinabox commented on June 4, 2024

Ah, I have it.

ResumableFunctions doesn't handle functions with varargs right.

@resumable function foo(xs...)
    @yield xs[1]
    @yield xs[2]
end

collect(foo(3,4))

Output:

BoundsError: attempt to access ((3, 4),)
  at index [2]

Stacktrace:
 [1] getindex(::Tuple{Tuple{Int64,Int64}}, ::Int64) at ./tuple.jl:21
 [2] (::##974)(::Void) at /home/wheel/oxinabox/.julia/v0.6/MacroTools/src/utils.jl:132
 [3] _collect(::UnitRange{Int64}, ::##974, ::Base.HasEltype, ::Base.SizeUnknown) at ./array.jl:442
 [4] collect(::##974) at ./array.jl:431
 [5] include_string(::String, ::String) at ./loading.jl:522

from resumablefunctions.jl.

BenLauwens avatar BenLauwens commented on June 4, 2024

Hi

The problem is the splatting of the varargs. I have implemented a fix in the master branch. I added a test and it seems to work... Can you test that this solves your problem.
Thanks!

Ben

from resumablefunctions.jl.

oxinabox avatar oxinabox commented on June 4, 2024

Done and looking good

from resumablefunctions.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.