Giter VIP home page Giter VIP logo

Comments (2)

amalloy avatar amalloy commented on August 26, 2024

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.

nicksieger avatar nicksieger commented on August 26, 2024

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)

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.