Giter VIP home page Giter VIP logo

Comments (3)

owenRiddy avatar owenRiddy commented on June 12, 2024 1

Implementing proxy-super properly seems a bit hard. I couldn't figure out how to detect whether the code is in a context where it is usually legal to call the superclass or not.

I've implemented a horrible hack while we wait for competent people to puzzle that one out. https://github.com/owenRiddy/proxy-plus-minus implements a proxy-super+ by automatically exposing the superclass' methods to everyone and hoping that people behave responsibly and/or don't consider such an audacious scheme and only put proxy-super+ in sensible places. This implementation should avoid https://clojure.atlassian.net/browse/CLJ-2201 and be usable in situations where thread safety is important.

I won't ask for my work to be pulled into proxy-plus because I consider my efforts an affront to good software engineering and live in hope that someone will think of a better way.

from proxy-plus.

nathanmarz avatar nathanmarz commented on June 12, 2024

That's clever. Definitely too much of a hack to pull it in though. I think doing this properly would ultimately require support from the Clojure compiler.

from proxy-plus.

owenRiddy avatar owenRiddy commented on June 12, 2024

I think doing this properly would ultimately require support from the Clojure compiler.

It'd be helpful. Although after spending 24 hours mulling I'm not sure even access to the compiler is enough to get to an elegant proxy-super+ so I'm not holding my breath.

We're up against a really awkward crack in the design. Clojure functions are independent of the object that represents the proxy - therefore any attempt to replicate the behaviour of Java's super will lead to weirdness because at the technical level there has to be a mechanism for one object to reach out and call another object's shadowed methods. Any restrictions on that are arbitrary.

Seems to me we need new semantics of what is reasonably allowed access to superclass methods (only lexically in the proxy+? functions 1 deep in the call stack? Functions in the same namespace as the call to proxy+? On the thread between when a proxied method starts and ends executon? Everything, everywhere all at once?).

Case closed for the moment I suppose.

from proxy-plus.

Related Issues (11)

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.