Coder Social home page Coder Social logo

Comments (3)

kkinnear avatar kkinnear commented on August 17, 2024

Noah -- thanks for asking!

Yes, I added disssoc to the :fn-map because, as you say, there had been nothing there for it previously. So what happened was that the capability I call "constant pairing" came into play, and caused multiple keywords to pair up. As you have shown in your example. Since the keywords in dissoc don't actually have any relationship to each other, pairing them up seemed to imply something that was misleading. They are paired up in assoc because they are key-value pairs. To prevent this pairing, I put dissoc in the :fn-map and turned off constant pairing at the first level. I also made it :arg1 since its first argument was special, like assoc.

You can certainly revert that behavior by, as you note, setting the fn-map for dissoc to :none, and it will go back to the way it was. If you really don't like the :arg1, I would recommend, however, that you replace :arg1 with :none in the :fn-map, but leave the constant pairing turned off. You can't actually do that directly, you would need to replace what's there with

[:none {:list {:constant-pair? false}, :next-inner-restore [[:list :constant-pair?]]}]

That way you won't get the constant pairing. Unless you really like that for some reason?

Anyway, that was my thinking on this change. It is always hard to decide to change some default value, but in this case I felt that it was really misleading people, and that is exactly the opposite of my goals.

from zprint.

NoahTheDuke avatar NoahTheDuke commented on August 17, 2024

Cool, that makes a lot more sense, thanks. Maybe noting that in the changelog will prevent further confusion.

I think our goals are at cross purposes, which is understandable. Yours is to build a general tool for the community that is semantic and beautiful and mine is to change as little as possible in my company's codebase when updating libraries. I agree that the way dissoc worked pre-1.2.5 is semantically misleading and shouldn't have been that way, but with a team of 50, adding ~10 extra files of changes increases the probability of merge conflicts and issues down the line. (This is especially relevant with the tuning changes. I'm using :original-tuning even tho it's objectively worse because otherwise, the diff goes from 96 files touched to 371.)

I'm not saying you have to be as conservative as the clojure.core team, just want to highlight why someone might want to keep things that are currently working as close as possible when updating.

Thanks as always for your work on zprint.

from zprint.

kkinnear avatar kkinnear commented on August 17, 2024

Thanks for the comment. I've been in exactly your position (though I'm not at present) and I totally understand. That's why I try to always give people a fallback to the "old way" -- when I can. Thanks for reminding me of the consequences of my changes. It is always good to keep an eye on the pain I'm causing people!

from zprint.

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.