Comments (4)
This is an interesting idea, and I agree that it would make the output easier to interpret. I haven't noticed deep-diff output being out of order, possibly because I mostly use deep-diff2 through Kaocha, so I don't see the original order. Is there a particular situation where this came up in?
I don't how optimized ordered collection libraries are or how big of dependencies they are, so I wonder if the best way is to make it configurable, require the user to provide the dependency, or both.
from deep-diff2.
The thing is that this will only help if people are themselves using ordered collections in their code, since otherwise the order we read them in is not deterministic. For small maps clojure maintains source order (PersistentArrayMap). Once you get to bigger sizes it automatically switches to PersistentHashMap, and you can no longer depend on any ordering.
from deep-diff2.
@alysbrooks No particular situation, this was literally just a Friday thought :)
I wonder if the sorting could be applied after diffing? After all it's more of a view thing than anything.
from deep-diff2.
I think there are two ideas here:
- Add support for
flatland.ordered
collections. This should be done in a bring-your-own-dependency fashion—we don't want to pull in this library if people aren't using it. - Sort. This can be probably be done by the library user but isn't straightforward since the
Deletion
andInsertion
objects don't implementComparable
.
I think we'd welcome a PR for either.
The main reason to not accept support for flatland.ordered
is that it could be a maintenance burden for a feature very few people use. On the other hand, that library appears to be very stable. We'd definitely want tests for it.
from deep-diff2.
Related Issues (20)
- round-trip error with ###NaN HOT 4
- Print java.time.Instant as #inst HOT 6
- How to skip printing values same in both structures? HOT 10
- Consider tweaking colors to draw eye to differences HOT 12
- Closure compilation failed HOT 4
- Extract cljs port of puget
- Fall back to the system printer
- ddiff not terminating HOT 7
- Cljdoc analysis is failing HOT 5
- Round-trip error
- Fails with records with deleted keys
- Show diff at deeper level (Sets) HOT 4
- test issue for action
- Parameterize color schemes HOT 7
- Improve set handling HOT 3
- Hashmap key order shouldn't matter HOT 2
- Print string-based diff if there's a mismatch of two strings HOT 3
- Prettyprinted diff mangled when using advanced compilation in cljs HOT 6
- `#uuid` and `#inst` printing HOT 1
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 deep-diff2.