From a brief look at the code, rets acts like many “boxes” that receives different values. They are used in the (go-loop …) in the same fn. So I believe they actually need to be different instances rather than the same instance. (but I could be misunderstanding the code)
done
are a vector of callback functions that each take ret
I feel like I’d need to spend a bit of time with that code to understand the intent there. I might be totally off.
Is the copyOf
causing a problem for you?
I have several alias in deps.edn. Is it possible that an alias refers to another alias? So I want to makeasecond alias that changes the params passed to the first alias. leiningen can do this, and wondering if deps can do it too.
@hoertlehner No, that is not possible.
Aliases can be “data” but only certain places can accept an alias instead of data: :exec-args
can be an alias that refers to data, some tools like depstar
and deps-deploy
support exec args that are aliases and substitute their values.
thanks @seancorfield
:paths
and :extra-paths
can also accept aliases and look them up as data.
Are there any resources on making small jars? I wanna participate in the 4MB Game Jam and would prefer to use Clojure
have you tried avoiding AOT compilation? i.e. your jar (uberjar?) will include only .clj files
You'll still need Clojure's runtime itself which is about 4MB on its own I believe?
maybe cljs compiled to js and gzipped could yield <4mb
Hi! Is there a nicer way to go from {:a [1 2 3] :b [4]}
to {1 :a, 2 :a, .., 4 :b}
then this rather manual:
(into {}
(for [[k vs] {:a [1 2 3] :b [4]}
v vs]
[v k]))
? Thank you!Looks pretty straight forward to me. Only thing to think about is what to do with duplicate values in the keys in the original maps. If those are possible, and if so, who “wins”
a .jar doesn't have to include the clojure runtime. it can include merely the game sources/assets and then the users would add the clojure runtime to the classpath (it's a .jar)
so one would build a classpath of two .jars
perhaps a more friendly and "official-looking" approach would involve the clojure
cli tool, so that one only adds the game .jar
Thx! Good point! But in this case, duplicates do not occur.
I wasn’t sure what the restrictions were in “4MB Game Jam” (I’d never heard of it until @nbtheduke mentioned it here).
Since asking I’ve found out I’d have to include the JRE in the 4MB limit, which makes this whole thing much harder. Think I’ll try Lua instead.
Yeah, I just Bing’d it and saw the Reddit thread where they explicitly say that HTML5 and browser-based stuff is out, and anything on the JVM is out, since the entire runtime must be counted in the 4MB — which deliberately excludes a lot of game engines too.
it’s really not any cleaner than your solution but this came to mind
(reduce-kv (fn [m k vs] (into m (for [v vs] {v k}))) {} {:a [1 2 3] :b [4]})