This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-14
Channels
- # beginners (183)
- # boot (6)
- # cider (106)
- # cljs-dev (17)
- # cljsjs (2)
- # cljsrn (2)
- # clojure (56)
- # clojure-italy (14)
- # clojure-nl (39)
- # clojure-spec (49)
- # clojure-uk (138)
- # clojurescript (197)
- # core-logic (37)
- # cursive (22)
- # datascript (5)
- # datomic (29)
- # devcards (18)
- # emacs (1)
- # events (8)
- # figwheel (1)
- # fulcro (59)
- # lein-figwheel (1)
- # leiningen (1)
- # off-topic (54)
- # onyx (3)
- # pedestal (1)
- # portkey (4)
- # re-frame (18)
- # reagent (5)
- # reitit (43)
- # ring (6)
- # ring-swagger (26)
- # shadow-cljs (42)
- # spacemacs (8)
- # specter (12)
- # sql (3)
- # tools-deps (21)
- # vim (18)
anyone seen core.match return "method code too large" when you get up around 6 patterns?
macros that write a lot of code can do that. the jvm only allows method bodies to be so large and the match macro can expand to be too large
there’s a ticket about this
crouton
+ spectre
for parsing & pulling values out of html is working very nicely for a quick scraping job I had. Once the dom is in a regular clojure data structure it's super easy to write functions to access the data.
I used enlive
for html parsing and scraping
Also works for templating
@dpsutton “the jvm only allows method bodies to be so large”. Heh-heh, the JVM blind-sided by macros? Gosling/Steele failed to anticipate Mr. Hickey.
I have a protocol function with 2 arities (2 & 3). Is there a way to add an extra arity (4) with common body to all implementations? I could do this easily with a separate function with different name, supporting 2,3 & 4 arities, but would like to know is there another way.
hmm .. what’s the most clear way to say “this map will have 1 of 2 types of keys, give me one of those 2 keys” .. like I could do (first (keys (:select-keys map [:foo :bar])))
which would give me :foo
or :bar
but it’s kind of icky
Curious if anyone has any thoughts on this thread about figuring out which Clojure core functions rely on which protocols/interfaces. Been stumping me for months, and it makes designing new data structures a challenge for me. See the original thread for full conversation.
I tangled with this for schism (e.g. https://github.com/aredington/schism/blob/master/src/schism/impl/types/map.cljc).
My experience is: In clojure most of the core types are not implemented with protocols but instead with the clojure jvm types and their interfaces in https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang In ClojureScript there are protocols that mirror the core interfaces you need to implement starting at https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L532
but in order to use that, you have to know the java interfaces you want to extend, and the only way to find that is often to look at the source of the function you want to work on your collection, then find the method in RT that function calls
There is a now a #datahike channel https://www.reddit.com/r/Clojure/comments/8r051c/datahike_a_lightweight_open_source_alternative/
is there any way to splice a value into a quoted form? e.g.
'{:find [(pull ?e ~reusable-pull)]} -> '{:find [(pull ?e [:my-pull])]} ; ?
; this instead evaluates to:
'{:find [(pull ?e [(clojure.core/unquote reusable-pull)])]}
there are also some libraries that provide something like syntax quote, but more customizable
Does someone know why was clojure.contrib deprecated from clojure?
https://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go
have a lot of the background
Anyone know a good example of an implementation of https://github.com/metosin/reitit ?
@josh_tackett You may want to ask this in #reitit.
Is there a simpler way to achieve this that I may be forgetting?
(defmacro compile-time-eval [form]
(eval form))
you can just put form in a def or a top level let and get the same result
you’d need to name it then 🙂
it’s intended for single use inline evaluation
I kind of need to know the context to avoid the xy problem but syntax-quote is typically used in a macro
The intent is to allow a def like form that is used only once to be directly placed in its single use code context.
will post in a bit
thanks for looking at it
wouldn't that eval be different as it would return the code to be compiled rather than the item? unless what it returns is always self-evaluating of course
I could be missing something
has anybody experienced problems with Class/forName
not finding classes when used by dependent code? i have a ns that imports a class successfully, i can even use Class/forName
to fetch it again from that ns. but during a test run, when the same function is used by a third-party library to load the same class, it fails with ClassNotFoundException
. it doesn't appear that the library is using its own classpath loader.