This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-23
Channels
- # announcements (19)
- # babashka (6)
- # beginners (47)
- # cljs-dev (4)
- # cljsrn (3)
- # clojure (18)
- # clojure-australia (3)
- # clojurescript (50)
- # code-reviews (1)
- # conjure (16)
- # datomic (6)
- # editors (4)
- # emacs (1)
- # fulcro (10)
- # graphql (3)
- # helix (7)
- # jackdaw (10)
- # malli (1)
- # off-topic (3)
- # pathom (4)
- # sci (2)
- # shadow-cljs (39)
- # testing (3)
- # tools-deps (5)
- # vscode (1)
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 @U04V70XH6
: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?
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).
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.
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 😄
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”
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]})