Giter Club home page Giter Club logo

Comments (6)

raxod502 avatar raxod502 commented on May 29, 2024

Does anybody have a good idea about the user interface for this?

One option would be to have a dynamic variable that one could bind, defaulting to nil, around a definition. Then patches defined with different values for that variable would be distinguishable. We could even make the use-package integration bind this variable by default to different values in the :init/el-patch and :config/el-patch blocks, thus solving the most common use case without the need for your configuration to change.

Thoughts?

from el-patch.

 avatar commented on May 29, 2024

In my opinion, multiple patches to the same function does not make sense. At that point what you have is one patched function, which is still used internally wherever it has been used and a new function you want to use explicitly. Swapping its definition before and after module reloads seems extremely hack-y and error-prone.

from el-patch.

raxod502 avatar raxod502 commented on May 29, 2024

one patched function, which is still used internally wherever it has been used

Can you elaborate? Unless some code explicitly extracts the return value of (symbol-function 'the-patched-function) and saves it, updating the patch will also update all callers unconditionally, which seems straightforward enough to me as a set of semantics.

from el-patch.

 avatar commented on May 29, 2024

Yes, and that is the purpose of this package from what I understand. Not making symbols/defuns have different meanings at different points in time?

from el-patch.

raxod502 avatar raxod502 commented on May 29, 2024

It's a package for future-proofing the operation of overriding the implementation of a function. Sometimes, one wants to override the implementation of a function to different values at different points in time. el-patch can future-proof this operation too.

from el-patch.

 avatar commented on May 29, 2024

Fair enough. You may also want to add support for temporal logical operations while at it.

from el-patch.

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.