This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-02
Channels
- # announcements (5)
- # beginners (36)
- # biff (2)
- # calva (51)
- # clojure (12)
- # clojure-austin (7)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (63)
- # clojure-uk (2)
- # community-development (5)
- # core-typed (10)
- # datomic (9)
- # graalvm (6)
- # honeysql (1)
- # jobs (4)
- # leiningen (14)
- # london-clojurians (1)
- # lsp (23)
- # malli (88)
- # missionary (10)
- # off-topic (41)
- # practicalli (7)
- # re-frame (1)
- # reitit (5)
- # releases (2)
- # remote-jobs (1)
- # ring (11)
- # squint (2)
- # xtdb (5)
Some personal insight
Today I realized that I don't need to call a function prepare-general-stacked-column-chart
while it lives in the domain.stacked-column-chart
namespace and I can just call it prepare-general-chart
as it will become domain.stacked-column-chart/prepare-general-chart
in use anyway.
> it will become domain.stacked-column-chart/prepare-general-chart
in use anyway.
Only if you use a fully qualified namespace.
If you use an alias, it might end up being the-alias/prepare-general-chart
.
But of course, aliases should be chosen in a way that makes it obvious what it points to. :)
The alias ends up being stacked-column-chart/prepare-general-chart
in use. This use also only happens in a place specific to domain
, so I have domain.subdomain1
and domain.subdomain2
in use so it's not a problem
Thank you for pointing this out
I shrunk domain.subdomain1.stacked-column-chart
in the original message for brevity 😅
A slightly stupid question. The source code for partial has multiple fn definitions for both argument arities and the arities on the closure. Why is this?
I mean, I am guessing it is for some sort of efficient call. But what exactly makes this an optimal way of writing it?
Without explicit arities, a vararg function would have to be used. It is simply less efficient.
The function stops at 3 arguments. I am guessing that is the tipping point between it being efficient and it being ludicrous?
Though, anything with more than 3 arguments should probably be closed in a different way as opposed to invoking a partial.
Specifically an array has to made at runtime to support the varargs, I believe
> I am guessing that is the tipping point between it being efficient and it being ludicrous? That would be my guess, yes.
we have some ideas about making vararg handling more efficient that may make this unnecessary in the future (tip the balance away from unrolling)