Fork me on GitHub
#rewrite-clj
<
2022-07-24
>
steveb8n00:07:17

Q: I would like to express a navigation using zipper steps as data. Is there a way (or an example) of how to do this?

steveb8n00:07:42

i.e. instead of this code… (-> zloc (z/find-value z/next ’foo) (z/down)) I’d like to use something like… [{:op :find-next :target ’foo} {:op :down}]

steveb8n00:07:49

I could create a multimethod DSL for something like this or a macro but I’m wondering if this already exists?

lread01:07:40

Not that I know of @U0510KXTU!

steveb8n04:07:11

Ok. Should be easy to build myself

steveb8n08:07:54

It was indeed easy and simple. Data driven navigation ftw

lread02:07:19

Coolio, whatcha building, anything that you can talk about?

steveb8n04:07:13

this is for Hotplate which is a tool I use to generate/create applications. it’s not yet OSS but I will open it up once I have the resources to manage it. when I do, touch base and I’ll show you where this little DSL is used

steveb8n04:07:55

it reminds me a lot of Specter navigators. I bet there’s quite a diaspora of navigation DSLs in the clojure world

steveb8n04:07:32

this is the UI for it

steveb8n04:07:13

btw clj-rewrite is one of the most valuable libs in Hotplate so thank you heaps for your efforts

lread14:07:11

Neat! Thanks for sharing and also for the kind words!