This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-03
Channels
- # announcements (11)
- # aws (1)
- # beginners (57)
- # calva (14)
- # cider (22)
- # clara (23)
- # cljdoc (21)
- # cljs-dev (14)
- # clojure (76)
- # clojure-austin (3)
- # clojure-europe (32)
- # clojure-finland (1)
- # clojure-gamedev (5)
- # clojure-italy (3)
- # clojure-nl (17)
- # clojure-poland (4)
- # clojure-spec (23)
- # clojure-uk (29)
- # clojurescript (72)
- # cursive (6)
- # data-science (4)
- # datomic (2)
- # dirac (10)
- # duct (3)
- # emacs (1)
- # figwheel-main (10)
- # fulcro (86)
- # jackdaw (5)
- # juxt (2)
- # kaocha (2)
- # leiningen (16)
- # off-topic (47)
- # pathom (46)
- # protorepl (2)
- # reagent (4)
- # reitit (14)
- # ring-swagger (5)
- # shadow-cljs (43)
- # spacemacs (13)
- # sql (13)
- # tools-deps (6)
#aws is a good place to ask this
Thanks @alexmiller
Hi. I'm trying to use compile
with a gen-class. I get a class not found exception when the constructor is defined taking a class from a lib I'm using. I can import that same class, and changing the type to eg String makes compile work. Any caveat about types for constructor args and class path etc?
what would be closest and cleanest way to have "cron jobs" in Clojure. Something to run every some time from within web app. Like @Scheduled in Java Spring...
@twaima Java's ScheduledExecutorService works well but you can also write something custom with a core async go loop and timeout
and chime
and at-at
yeah, the scheduling part of tick is deprecated tho 😞
Is there a better way to split a list of pairs into lists of the firsts and seconds than [(map first pairs) (map second pairs)]
? Thank you!
thx but I want the opposite: ([1 2] [4 5] [7 8])
-> ([1 4 7] [2 5 8])
since map
takes multiple collections, you can do:
(->> [[1 2] [4 5] [7 8]]
(apply map vector))
=> ([1 4 7] [2 5 8])
Nice! But it will break if there are too many elements, map isn't defined for any number of args
I don’t see that limitation… just ran it for a vector of 50000 pairs without issue…
(apply map vector (partition-all 2 (range 100000)))
am I misunderstanding what you mean by too many elements?
Does map take up to 50k arguments or am I missing something? Or does apply do something else than (map fn pair1... pair50000)?
Ah I see https://stackoverflow.com/questions/2735600/why-is-there-a-limit-of-max-20-parameters-to-a-clojure-function > First of all, the limit only applies to required positional arguments; you can always use the variable arity case (& more-args in the function's signature) to handle as many arguments as you want to Thanks, today I learned 2 useful things!
sweet! 🙂
I've used quartzite before, while it works great, it's a bit heavy with some learning curve as you kind of need to know how Quartz works.
There's one in cgrand's xforms
library along with many other transducers:
https://github.com/cgrand/xforms/blob/master/src/net/cgrand/xforms.cljc#L491
Repo: https://github.com/cgrand/xforms
i'm trying to bundle a Clojure desktop app to be executed stand-alone on macOS & Windows. anyone know of some resources on how best to do that with JDK 11?
I used javapackager
for this (a long time ago though so not sure about JDK 11)
Is "Clojure Programming: Practical Lisp for the Java World" still a relevant book to learn clojure?
fn-fx?
yeah. just got done creating a simple app; seems good, still don't understand a lot
now I'm trying to figure it out how to distribute it to my coworkers who might not have JDK 11 😬
My little hobby app was macOS only. FWIW I used https://github.com/Jorl17/jar2app along with JavaAppLauncher built from https://bitbucket.org/infinitekind/appbundler/
High level noob question: would using datomic ions for a normal page serving ring app (i.e. not an api or event triggered code etc) be a bad fit for some reason?
has anyone encountered any sort of linting / analysis tools that could detect whether a change on a clj codebase maintains some notion of backward compatibility?
I think that's Rich Hickey's research project, when I asked a while ago, I was told it's not close to fruition yet.
will be very interested to see what he comes up with 🙂 coincidentally, this question came up after thinking about the spec-ulation talk
@devn Most channels here are mirrored into Zulip via @zulip-mirror-bot (which you can invite to any channel it isn't already a member of). https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive
thanks @dpsutton and @seancorfield
other question for ya: I remember alex miller saying something about some interesting business required to get constant-time dispatch in case
. I've been reading over it, but wondered if anyone here knew the details well enough to give their take on what's going on here.
the deeper i dig, the more questions i have
max-switch-table-size
, case-map
, prep-ints
, prep-hashes
, max-mask-bits
, maybe-min-hash
, etc. etc.
curious about why case-map
builds a sorted-map
, where the value for max-mask-bits
comes from
so as I understand it the big picture is constructing a lookup table out of your case call at compile time (you probably know that part already)
yeah, i might be misremembering, but i feel like there was some relation to the bytecode that's emitted maybe?
right, case is a special form, that means it takes your form as input, and produces byte code as output
and the job with case is to turn the whole call into one table lookup (which is why all dispatch must be compile time literals - you can't calculate the dispatch correctly otherwise)
the rest of what you find there is implementation of that concept (as I understand it)
oh, right, case*
is the special
yeah, I elided that distinction above as well
so the case
macro does a bunch of prep work with the input form, and produces data that's tied to the implementation details of the case*
special form (bit-mask, hash implementations ...)