This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-19
Channels
- # 100-days-of-code (12)
- # beginners (116)
- # calva (2)
- # cider (16)
- # cljdoc (5)
- # cljs-dev (26)
- # clojure (161)
- # clojure-italy (7)
- # clojure-nl (9)
- # clojure-spec (49)
- # clojure-uk (112)
- # clojurescript (50)
- # clojutre (4)
- # core-async (2)
- # cursive (4)
- # datomic (192)
- # emacs (10)
- # events (4)
- # figwheel-main (147)
- # fulcro (94)
- # graphql (5)
- # instaparse (1)
- # jobs-rus (1)
- # keechma (10)
- # leiningen (223)
- # luminus (3)
- # mount (23)
- # nrepl (8)
- # off-topic (44)
- # onyx (10)
- # pedestal (5)
- # re-frame (19)
- # reitit (8)
- # shadow-cljs (62)
- # uncomplicate (3)
Should I not be messing with an HTML table at all, and I should just be modifying the order of the data?
@its.ramzi specter is difficult to import?
Hey, does anyone know if there's an equivelant of delay without the caching behavior?
i downloaded specter from github and there were java, cljc, and clj files. i didnt know where to put the java files
err, sorry, I might not be understanding you correctly. all you need to do is specify it as a dependency in your project.clj:
:dependencies [...
[com.rpl/specter "1.1.1"]
...]
@idiomancy I'm not aware of a non-caching delay, but I suspect you could make your own fairly easily
(defn non-caching-delay [f]
(reify IDeref
(-deref [_] (f))))
Since this is not a macro, you'd have to pass a thunk as in
(def my-non-caching-delay (non-caching-delay (fn [] ,,,)))
You could go farther and make a macro that builds the thunk for you, just like the delay
macro does.
From the bigger picture, it seems like you could just define a function and call it. All the above really buys you is the ability to use deref
.
Interesting problem. I suppose you have a large value you don't want to hold onto in a delay
or a value that otherwise can become stale.
what about an unbuffered core.async channel?
sounds like you basically want a rendezvous
java.util.concurrent.SynchronousQueue accomplishes the same (if you want interop and no dep)
oh crap, didnât realize what channel I was in :)
Heh. I once asked for a napkin when in London. Same language, but different semantics.
well, since we're all here, does anyone want to help me polish this macro off?
(defmacro derefable [& body]
`(reify IDeref (-deref [~(gensym)] ((fn [] ~@body)))))
(derefable "hello")
=>
---- Compiler Warning on <cljs form> line:1 column:1 ----
Bad method signature in protocol implementation, clojure.lang.IDeref does not declare method called -deref
1 (derefable "hello")
^---
---- Compiler Warning ----
@idiomancy You just need to qualify a couple of things:
(defmacro derefable [& body]
`(reify cljs.core/IDeref (cljs.core/-deref [~(gensym)] ((fn [] ~@body)))))
It is definitely OK. It is used in a few places in the shipping libs. Here is one example https://github.com/clojure/clojurescript/blob/1a155adb0984de26b9606d8aa7c0e1388567eb0b/src/main/cljs/cljs/spec/test/alpha.cljc#L145
You'll also see it if you do (source simple-benchmark)
for unused binding name in dotimes
hello, maybe someone could help me đ is there some alternative to aget? for e.x. (aget (aget (first (aget data "results")) "name") "first")
@puremonad you mean like goog.object/get
?
you can also do property access (for valid identifiers) with the (. obj -prop)
or (.-prop obj)
syntaxes
@puremonad do note that property access is NOT the same as aget. property access will get munged in advanced compilation unless you have externs defined for the object you are accessing
it's a tricky thing because it will work in development and then potentially fail in production if you're not careful
Do you guys know any good read on CLJS and deployment?
Compile into a bundle. Upload to S3. Put it behind a CDN
@coderdanger we really donât do anything novel here - same best practices as JavaScript
I had a brief look but I couldnât find anything useful there. Whatâs your use case for Vue + CLJS? In my findings, I couldnât find anything in Vue that transported over to CLJS.
The Vue template language gets directly translated to JS, so you canât hook CLJS in there. The Vue âinstancesâ rely on proxies etc so they wonât work with CLJS data structures. There is no custom event system like React has so no extra value there. In the end, youâd be using Vue only for the VDom implementation, which I havenât compared to others yet.
I found this one https://github.com/Gonzih/glue