Git Product home page Git Product logo

Comments (2)

gares avatar gares commented on July 19, 2024

Refactor code of declare-instances as follows:

  • given T find all mixins: findall (mixin-for T M X)
  • check duplicate results are just aliase, i.e. for a given M, all the Xs should be convertible
  • then, find all the classes that can be inhabited using these mixins, by exhausting the mixins rather than the classes

Also, refactor get-canonical-mixins-of to get only one mixin-src per mixin, (because we ourselves maintain the invariant of convertibility). Maybe add a HB.check_instance_convertibility for debugging?

EDIT by Cyril

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 19, 2024

In fact, it appears that the important check to do is when doing HB.instance Definition _ := F.Build T ..., the mixins generated by F that were already declared for T are compatible. Otherwise fail with a nice error message, e.g. The factory F tries to build `m1` ... `mn` in a way which is incompatible with previous instances on `T`, please use a "smaller factory" (and even better if we can suggest factories)

from hierarchy-builder.

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.