Comments (6)
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.
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.
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.
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.
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.
Fair enough. You may also want to add support for temporal logical operations while at it.
from el-patch.
Related Issues (20)
- Autoloading a patch HOT 4
- el-patch-validate-all fails on first missing file HOT 5
- el-patch-validate-all fails with "apply: Cannot open load file: No such file or directory" HOT 3
- Automatically validate patch after evaluating them HOT 1
- Patch function without providing complete source in patch HOT 6
- How to patch vector literal given with backticks HOT 2
- Finding source after compiling patch HOT 2
- Patch function in a compiled init.el HOT 10
- el-patch validates against macro-expanded version of function HOT 3
- void-function: el-patch-fontify-as-defun HOT 6
- New release HOT 2
- Trying to patch long function without copying the old one HOT 5
- Suggestion: Use advice system for patching functions HOT 3
- Renaming default branch from 'master' to 'main'
- Patches get silently overridden on package update / native compilation HOT 2
- Can I use this to verify a function I'd like to advise? HOT 1
- Overriding concat definition HOT 1
- Enhancement: add ability to patch variables defined in C code HOT 2
- Enhancement: add ability to unpatch evaled templates HOT 2
- Bug: templates that don't contain `...` and don't deal with their original form completely are incorrectly considered valid HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from el-patch.