Comments (7)
Maps now require meta
and with-meta
handlers. The example should be updated.
from potemkin.
I've updated the related documentation.
from potemkin.
Is the branch for 0.3.12-SNAPSHOT private? I would like to see the updated example.
I feel like I've gone through every possible combination of with-meta
, withMeta
, meta
on their own and with clojure.lang.IObj
but I keep running into the same exception every time.
from potemkin.
Sorry, I made the change just before going to bed, and apparently neglected to actually submit it. Let me know if the example in the docs doesn't work for you.
from potemkin.
I'm trying this:
(def-map-type Foo [x]
(get [this key default] (get x key default))
(assoc [this key val] (assoc x key val))
(dissoc [this key] (dissoc x key))
(keys [this] (keys x))
(meta [this] (meta x))
(with-meta [this m] (Foo. (with-meta x m))))
which fails with:
CompilerException java.lang.IllegalArgumentException: No single method: with_meta_STAR_ of interface: potemkin.collections.PotemkinMap found for function: with-meta* of protocol: PotemkinMap, compiling:(/Users/Olli/Development/clojure/herm/src/herm/game/ranges.clj:76:5)
I feel like I might be overlooking something really simple, but shouldn't this be working?
EDIT:
The README example fails with the same exception.
from potemkin.
Your code works for me on the latest code in master
(and I believe should have been working for a while). Are you sure that's what you're using?
from potemkin.
You are right. There was a conflict with my profiles.clj file, with the following dependency vector: [leiningen #=(leiningen.core.main/leiningen-version)]
. I had it in there because vinyasa requires it. I don't know what about it is that causes the problem, but I have got rid of it now. Thanks for your patience.
from potemkin.
Related Issues (20)
- Add Serializable support HOT 1
- Upgrade riddley to allow referencing vars from deftype+ body HOT 2
- Source for 0.3.13 HOT 2
- Macros define var even if not evaluated HOT 1
- Any chance of a version of import-vars that works for cljc? HOT 1
- Empty defprotocol+ bodies cause definition to not occur HOT 2
- Add examples for optional names to README
- Reconsider ClojureScript support? HOT 1
- Document how `import-vars` interacts with direct-linking and namespace reloading HOT 2
- def-derived-map has a broken hashCode if any key is nil HOT 3
- Metadata handling by `postwalk` in some cases
- Reliable JVM crash using definterface+ HOT 4
- wow, awesome naming! HOT 3
- def-map-type's predefined count doesn't run in constant time HOT 1
- Boxed math warning at unchecked-add
- Question: why so many ancestors difference betwence Clj map and a PotemkinMap? HOT 1
- Top-level namespace breaks jdeps analysis HOT 2
- docs: describe defprocotol+ HOT 9
- docs: add caveat about import-vars? HOT 2
- `def-map-type` breaks in namespaces that shadow core Clojure methods like `instance?`
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 potemkin.