Welcome! Please see the About page for a little more info on how this works.

+6 votes
in Libs by

If Clojure is to become (even) more data oriented, these are powerful tools to achieve that goal. The community needs support to encourage adoption.

The current state of documentation for datafy and nav is not sufficient IMHO to encourage independent learning on a broad scale.

There is no canonical source of such documentation in the community despite some valiant efforts (eg @SeanCorfield who has a great blog post and is an active proponent).

Examples are difficult to find around the internet ... here's a good one from a Slack recommendation by @Frederick on there.

We know that there are problems with Slack since we cannot easily search history so keeping it here might help people find it in the meantime.

It would be good to have a rationale explaining the problem it is solving, the general approach and some specifics on the design.

Likewise a guide on how it should be used with a worked example and some hints and tips on how to approach implementations.

I know it's marked as alpha but this has not prevented docs on other aspects of the language.

1 Answer

+3 votes

Yes. Stu’s REBL talk has a pretty good overview for the context.


Similarly to REBL the shadow-cljs Inspect UI also makes use of datafy/nav. Don't know if there are other official goals for datafy/nav but it fits well for such data exploration tools. Many things are not data and difficult to inspect. datafy fixes that.

As a usecase example I have some custom classes in my shadow-grove WIP framework. When encountering instances in the REPL or Inspect you'd just get the default `#object [shadow.experiments.grove.component.ManagedComponent ...]` print representation which isn't very useful and doesn't tell you much about the object. However with a quick extend-type [1] you can make those object much more visible looking like regular clojure data.

[1] https://github.com/thheller/shadow-experiments/blob/master/src/main/shadow/experiments/grove/dev_support.cljs
Both Reveal and Portal leverage datafy/nav in a similar way to Cognitect's REBL:



Stu has a GitHub project that adds expanded namespace reflection for datafy/nav:


I also use this library for datafy/nav expansion of Java Time types:

Great, that's good news. Is there a timeline (eg with 1.11) or a ticket that can be upvoted as well as this question?
You can file Clojure web site requests at https://github.com/clojure/clojure-site/issues