Comments (2)
You're not really supposed to use data readers to embed foreign objects in your source code. Most of your test case is just distracting fluff: it's easily reproduced with the simple expression
#ordered/map ([1 2])
I don't know the details of how the compiler tries to understand map objects embedded in code, which make it come up with this exception, but basically it is just something you're not supposed to do. The tagged syntax is for transporting stuff across the wire, or persisting it to disk. That is,
(read-string "#ordered/map ([1 2])")
works fine, and that's what the feature is supposed to do. What you're doing is the same as
(eval (read-string "#ordered/map ([1 2])"))
which fails for a lot of reader-tagged objects. Do you have some compelling reason that you need this to work? I have trouble imagining a way in which the answer could be yes.
from ordered.
I understand now that use of reader-tagged objects in bare code is not something that you want to do typically. I encountered this error in code that embedded an ordered map in metadata while passing through a couple layers of macros. Switching away from an ordered map to a regular map made the issue go away. My best guess after finding out that I could trigger the error with #ordered/map ([1 2])
was that somewhere through the layers of macros the ordered map was being rendered by print-method
. I didn't find the exact culprit unfortunately (dense code), so it was still a guess at best.
I was able to fix this issue by fully-qualifying interfaces and protocols in map.clj
and changing the backing-map
field name to backing_map
(to avoid getting munged by the compiler). (Why fully-qualifying was necessary is beyond my comprehension of clojure's evaluator.) If you are interested in those changes I can put up a PR, but at any rate I agree with you that I don't think this is an issue that needs to be solved in your library.
from ordered.
Related Issues (20)
- What can it be used at? HOT 4
- [1.5.6] Must hint overloaded method: toArray HOT 5
- Interested in transitioning amalloy/ordered to clj-commons? HOT 1
- Can we get this to work on cljs? HOT 7
- ordered/set fails on Java 11 HOT 3
- Ordered pulls in useful
- Is it possible to get the min/max element? HOT 4
- ordered-1.5.8 gives reflection warnings
- data reader depends on imports being available? HOT 20
- Strange rendering at the repl HOT 4
- No changelog updates
- Reader literals assume imports HOT 5
- Make `ordered` auto-deployable
- Remove support for Clojure versions prior to 1.8
- Make `ordered-set` available for cljs
- Associative methods don't work on transient ordered maps HOT 1
- Add ordered set operations?
- Runtime resolve bloats native image size
- CI seems to suffer from bitrot HOT 1
- OrderedSet/hashCode throws an NPE if it contains nil HOT 5
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 ordered.