Fork me on GitHub

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.


:paths and :extra-paths can also accept aliases and look them up as data.

Noah Bogart17:05:49

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


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


I wasn’t sure what the restrictions were in “4MB Game Jam” (I’d never heard of it until @UEENNMX0T mentioned it here).

👍 3
Noah Bogart23:05:16

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.

👍 3

I was just about to reference the old .kkrieger game as a nice example of what people can do with just 96 kilobytes, but then I noticed that the game jam already references it as an inspiration 😄

Jakub Holý (HolyJak)20:05:03

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”

Jakub Holý (HolyJak)21:05:01

Thx! Good point! But in this case, duplicates do not occur.


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]})