Fork me on GitHub

I created a couple of new channels • #performance#idioms Please join if you are interested!

🎉 6

You might want to cross post in #new-channels


Looking at the source of,

{:added "1.0"}
  [branch? children make-node root]
    ^{:zip/branch? branch? :zip/children children :zip/make-node make-node}
    [root nil])
It uses metadata to store the information such as branch function and such. Isn’t using defrecord to define a newtype to be more straightforward?

Ferdinand Beyer13:06:46

defrecord was added in 1.2, zip in 1.0 🙂

Ed13:06:49 predates defrecord iirc


If it were written today, is using meta still a more sensible choice compared with defrecord?

Ferdinand Beyer16:06:09

Hard to say. Actually my first approach would be to just use a map. But other than Rich I did not study any literature on zippers, maybe it is more natural to represent it as a tuple?

Ferdinand Beyer16:06:17

The zipper structure seems to have two aspects: “Static” definition functions, stored in the metadata, and a state/cursor in the tree. The metadata never changes. So this could be an elegant solution, and allows you to print the “state” without the clutter (metadata)


Not sure if metadata would be the way to go if were written now, it is not the most performant solution. There are several alternative zipper libraries based on deftype with better perf, like


I don't think there's really a consensus about what you should and shouldn't do with metadata. I wouldn't say this is typical, and as pointed out there are more performant ways to do this now. Metadata is always a bit of a gray zone... It can be a convenient escape hatch, but a bunch of caveats apply.


@U07FP7QJ0 Unrelated to this, and a little bit off topic. I watched the video you presented back in 2018. Great presentation skills. Any advice/recommendation on how to practice these skills?


Oof that's a tough one... I've been doing these things for so long. Local user groups are great for practicing presentation skills. Even better if you can get a more experienced speaker to help you prepare and give feedback.


I think so. Reading books might not help, only first-hand practice makes a more difference.


Yeah I can really recommend finding a mentor, I've been part of some conferences that assign a mentor to each speaker. They help brainstorm the talk, help structure the slides, and then finally provide a test audience that can give you feedback. All of those kinds of input are valuable.


The other tip I would give you is to practice your presentations out loud. Stand up, grab your clicker, and just do the talk for yourself, many, many times.

thanks3 1