Giter Site home page Giter Site logo

Comments (2)

bakpakin avatar bakpakin commented on May 24, 2024 1

This is unfortunate behavior relating to closure capture. When you wrap the (test ...) code in the do form, and then create a local binding fun around |(spawn-sleep), you are accidentally capturing too much state with the ev/do-thread macro and that results in the above error.

I don't know if this is easy to fix, but I can look into improving closure capture to not capture the parent fiber.

Note that this also goes away if you use spawn-sleep directly, or move (def fun |(spawn-sleep)) out of the do block.

from janet.

bakpakin avatar bakpakin commented on May 24, 2024 1

I'm going to mark this as fixed for now, but I still think there are some improvements to be made here. While the fixes above prevent this kind of error from happening in the case of this macro, we still could reduce variable capture from closures even more than we do already.

from janet.

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.