Think of it as a square:

You start with an object of some sort (left side) -> datafy -> turns it
into pure Clojure data (including metadata). (right side)

Given pure Clojure data, you can navigate through it with get etc and you
stay in the right side (pure data).

Given that pure Clojure data, you can navigate back to the left hand wide
with nav, mimicking how get etc work.

So datafy is L -> R, get is R -> R, nav is R -> L on a "diagonal" that
takes you back to the object world on the left, corresponding to the place
on the right that you'd get to via get etc.

See if this blog post helps https://corfield.org/blog/2018/12/03/datafy-nav/


On Sun, Feb 2, 2020 at 1:22 AM Dimitrios Jim Piliouras <jimpil1...@gmail.com>
wrote:

> Hi Sean,
>
>
>
> Admittedly, I’ve never used REBL, and I did struggle with the shape and
> name of the `nav` arguments...
>
>
>
> In particular I’m struggling to understand why would anyone use `nav` to
> navigate to a key that already exists in the map...Can’t we just use `get`
> or `get-in`?
>
> You used the :format as an example, which works with nil, :iso, or a
> String pattern as the last arg to nav. But again, :format is NOT in the
> datafied representation.
>
>
>
> In essence, I’ve tried to use `nav` to navigate to things that can be
> expensive and don’t necessarily belong in the actual datafied
> representation.
>
> If the second argument to `nav`,  is expected to be a key already present
> in the map, then I really don’t understand what is the point of `nav`.
>
>
>
> kind regards,
>
> Dimitris
>
>
>
>
>
> *From: *Sean Corfield <s...@corfield.org>
> *Sent: *02 February 2020 07:36
> *To: *Clojure Mailing List <clojure@googlegroups.com>
> *Subject: *Re: ANN: jedi-time 0.1.4
>
>
>
> This is very cool but I would strongly recommend you try using this with
> REBL so you can figure out how to make the `nav` part work in a more
> natural way.
>
>
>
> nav is intended to work with a key and value (from the datafied
> structure), but your nav expects special values so it doesn't work with
> REBL.
>
>
>
> You can put (java.time.Instant/now) into REBL and your datafication
> produces a great data representation, but you can't navigate into it using
> the keys (and values) of the data structure itself. You can put :format
> into the nav-> bar and it defaults to a format you can get a string back,
> but none of the other nav calls will work.
>
>
>
> You might consider combining the :format key with the actual format, e.g.,
> :format-iso, :format-yy-MM-dd and if the key is something your don't
> recognize, just let it behave like regular data navigation.
>
>
>
> I think you're trying to do too much with nav, beyond "navigation". I
> think you could split some of the "clever" navigation out into a transform
> function that takes a datafied time and produces a new datafied time, and
> then let nav do the "conversion" back to Java objects. You've complected
> the transforms and the conversion right now.
>
>
>
> If you're on Slack, I'm happy to DM about this in more detail (when you're
> back from traveling).
>
>
>
> Sean
>
>
>
> On Sat, Feb 1, 2020 at 6:02 AM dimitris <jimpil1...@gmail.com> wrote:
>
> Hi folks,
>
> The first public release of `jedi-time` should be hitting clojars any
> minute now. I am traveling next week so may be slow to reply to
> feedback/bugs/PRs...
>
> https://github.com/jimpil/jedi-time
>
>
> Kind regards,
>
> Dimitris
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/8dbb9c5b-0ab0-fc76-6dc6-5e75b93d452a%40gmail.com
> .
>
>
>
>
> --
>
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles Networks, LLC. -- https://worldsinglesnetworks.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/CAD4thx-dwJkYYsGDWnD%3DAc7oaNBHqykGPzYhTHdWQRJmbk1DEw%40mail.gmail.com
> <https://groups.google.com/d/msgid/clojure/CAD4thx-dwJkYYsGDWnD%3DAc7oaNBHqykGPzYhTHdWQRJmbk1DEw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/5e3694b9.1c69fb81.8a875.d5ea%40mx.google.com
> <https://groups.google.com/d/msgid/clojure/5e3694b9.1c69fb81.8a875.d5ea%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles Networks, LLC. -- https://worldsinglesnetworks.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAD4thx8GRuxeGd-MrMSti%2BWRV1neRFOLWNh08xpb-Qrmya0kZw%40mail.gmail.com.

Reply via email to