This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-07
Channels
- # aleph (4)
- # announcements (7)
- # arachne (1)
- # beginners (138)
- # calva (5)
- # cider (1)
- # clara (14)
- # clj-kondo (1)
- # cljsrn (2)
- # clojars (4)
- # clojure (247)
- # clojure-dev (33)
- # clojure-europe (3)
- # clojure-italy (71)
- # clojure-losangeles (6)
- # clojure-romania (6)
- # clojure-spain (11)
- # clojure-uk (17)
- # clojurescript (95)
- # core-async (2)
- # cursive (19)
- # datomic (7)
- # duct (27)
- # figwheel (1)
- # graalvm (22)
- # juxt (7)
- # kaocha (8)
- # leiningen (1)
- # luminus (7)
- # lumo (4)
- # off-topic (38)
- # reagent (4)
- # reitit (11)
- # shadow-cljs (30)
- # spacemacs (42)
- # tools-deps (103)
- # xtdb (5)
The ticket doesn't really convey a strong sense of what is being solved to me, so I wonder if I am missing some context
zip would absolutely have been a better design with protocols (if protocols had existed when it was created)
I've written this same thing before
but just because we can do it is not a strong argument for why we should do it
perf is one possible reason
oh, looking at the patch you're actually cutting a different dimension than I thought
zippers themselves are a collection of 3 functions and I thought you were creating a protocol for that
you've got all the functions buried under one protocol method
I expected something like
(defprotocol Zipper
(branch? [this node])
(children [this node])
(make-node [this node children]))
tying those impls to concrete types is bad b/c you might want different functions for the same type
if dispatching on the concrete type was the idea here, I don't think it's a good one
Yeah, that is the other thing "protocolizing zippers" can mean different things, and this approach is the one I would expect the least
yes, looking at the patch, I was surprised
You might check out something like https://github.com/akhudek/fast-zip
even that is not what I'd expect :)
but the argument being made in that is perf
I wrote one way back when I wrote the zipper article in 2010/2011, but doesn't look I actually made a repo out of it
but to unroll back to a good question - what problem are you trying to solve?
what does this version do that the current version doesn't?
they're pretty much the same as Java loops in the bytecode
this might be nonsense but I’ll ask anyway: Maurizio Cimadamore mentioned in the Panama update from JVMLS that most loop optimizations don’t apply when using longs, am I correct that this would be an issue for Clojure loops as well since all primitive math is done with longs? https://youtu.be/r4dNRVWYaZI?t=2100