eggsyntax / datawalk

Interactively explore complex data structures at the REPL with minimum keystrokes
Eclipse Public License 1.0
275 stars 2 forks source link

Consider using pprint for printing data #2

Closed christianromney closed 6 years ago

christianromney commented 6 years ago

It would be really nice when printing the current data node e.g. via (w c) to pprint the data structure. Would you take a PR to implement this?

eggsyntax commented 6 years ago

Hi @christianromney , thanks for the input! My inclination is to split c into two different commands -- one that uses prn in the interest of being concise & suitable for copy/paste in the REPL, and one that uses pprnint. Does that feel like it would meet your needs well? I'm happy to take a PR, but also happy to just implement it, shouldn't take more than a few minutes. I can probably get to that tonight. Thanks!

eggsyntax commented 6 years ago

While I'm at it, I'm considering splitting all the other print commands in the same way -- I'm thinking of a convention like c to prn current data, C to pretty-print it. Same for p/P and m/M. Thoughts?

eggsyntax commented 6 years ago

OK, done -- C and M will now give you pretty-printed versions of current and saved data.

eggsyntax commented 6 years ago

Note -- didn't bump the version for this, so you may have to rm the old version from your ~/.m2/repository to get the refreshed snapshot.