Comments (2)
I use a multi method internally to register phrasers. What do you mean by "deleting a phraser"? Deleting a phrase is only possible by using remove-method
on the multi method. Can you please post your REPL session?
But you are right, there should be a way to remove phrasers. There is already remove-default!
which is not documented yet. I'll think about the best way to remove normal phrasers and phrasers with `:via.
from phrase.
I am referring to removing the method for a phraser, like you explain.
For example:
(defphraser pos-int?
[_ _]
"Please enter a positive integer.")
and
(defphraser pos-int?
{:via [::year]}
[_ _]
"The year has to be a positive integer.")
are actually two entirely different phrasers. But in the REPL if you were to do something like this:
=> (defphraser pos-int?
[_ _]
"Please enter a positive integer.")
#multifn[phrase* 0x7ffa2c90]
=> (defphraser pos-int?
{:via [::year]}
[_ _]
"The year has to be a positive integer.")
#multifn[phrase* 0x7ffa2c90]
The second pos-int?
is always going to shadow the first pos-int?
when phrasing problems for ::year
. It is not clear how to remove a phraser. When evaluating expressions in the REPL directly, you can tell that the library uses a multi method, but when you evaluate a buffer/file (e.g. in Emacs with Cider) you don't get this information and so it's even more unclear in that case. Also, I'm not super familiar with multi methods but just knowing that you use a multi method for registering phrasers doesn't actually help me in removing a phraser's method - I would also need to know the dispatch value that you use for registering the method - is that correct? Thanks
from phrase.
Related Issues (20)
- Update ClojureScript to Support Java 9 HOT 1
- doesn't seem to work with spec/merge HOT 3
- Should we have a phrase-all function? HOT 6
- Add required keys phraser example to README? HOT 2
- Confusing difference between s/explain and phrase on success HOT 2
- Confused about phrasing a `coll-of` HOT 3
- Binding pred HOT 2
- Test on more JDK's
- defphrase not matching set parameter HOT 1
- Ensure that Examples in README work in a ClojureScript REPL
- Fail to match coll-of min-count predicate HOT 1
- Simple or not doable??? HOT 5
- Fail to match distinct? predicate HOT 1
- Phrasing (s/int-in min max) HOT 1
- Please define phrase-all like so: HOT 1
- Fix Form Resolution Problem in Self-Hosted ClojureScript HOT 1
- phrasing error in recursive s/cat HOT 3
- Binding to clojure symbols fails HOT 1
- Capture Binding Symbols Should Shadow Global Symbols in Predicates
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 phrase.