Code Monkey home page Code Monkey logo

Comments (3)

kriskowal avatar kriskowal commented on May 28, 2024

Thanks, @bcw, I’ll take a look. And I’ll make a point to get better coverage on iterator. It is presently the lowest at 67% and I can do better. Glad that at least the idea of the iterator type is working out for you.

from collections.

kriskowal avatar kriskowal commented on May 28, 2024

Fixed in 3e1f9c9

from collections.

kriskowal avatar kriskowal commented on May 28, 2024

For reference, Node’s module system is designed to handle cyclic dependencies (I championed the CommonJS modules specification), but some care has to be taken to linearize the execution, usually by imagining the conjoined modules as a single file and placing require calls for every module in the clique in the position where the other module was elided.

Thankfully, @dherman’s proposal for modules in ES6 averts most of this problem by hoisting imports and exports into a shared scope (but allowing the same variable to have different names in each module, a feature I call “module sovereignty”—people in the know probably call it something else).

Which brings up another issue, @dherman. In this particular group of cyclic dependencies, the latter module uses a feature provided by the previous module in the course of its initialization. I believe @dangoor convinced you some years ago to execute a dependency module on the stack of the first import. This is an exemplar of the convincing use-case.

module "kriskowal/collections/generic-collection" {
    GenericCollection.prototype.addEach = …
    import "./array-shim";
}

module "kriskowal/collections/shim-array" {
    let GenericCollection = import "./generic-collection";
    Array.prototype.addEach = GenericCollection.prototype.addEach;
}

(details fudged)

from collections.

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.