Fork me on GitHub
#clojurescript
<
2018-10-17
>
heyarne07:10:34

what are the thoughts on predicates that return nil?

heyarne07:10:30

I'm working with some collection and in the end want to test whether for some item in it a condition holds, which i do with some

heyarne07:10:09

if it doesn't hold, some doesn't return anything, which is fine. it seems redundant to cast it to a boolean

heyarne07:10:43

but i don't want anybody else to read my code and make wrong assumptions because i ignored conventions

valtteri07:10:02

I’d follow what predicates in clojure core do. So my vote would go to returning booleans for consistency.

mfikes11:10:35

If a predicate returns a Boolean, the next release of the ClojureScript compiler will likely be able to infer this, and this will result in slightly more efficient code. See https://github.com/clojure/clojurescript-site/blob/news-next/content/news/2018-09-01-release.adoc#function-return-type-inference

🎉 20
abdullahibra13:10:00

i'm using this code: (.reload js/window.location true) to reload page, how can i modify it to do something after finish reloading ?

martinklepsch14:10:23

hey 🙂 when reloading the page all JS context is lost 🙃 What would you like to do after the page has completed the reloading?

isaac16:10:00

Compile cljs throws:

java.lang.Exception: No input matching "socket.io_client"
        at cljs.module_graph$canonical_name.invokeStatic(module_graph.cljc:179)
        at cljs.module_graph$canonical_name.invoke(module_graph.cljc:173)
        at cljs.module_graph$inputs__GT_assigned_modules$canon__4705$fn__4706.invoke(module_graph.cljc:216)
        at clojure.core$map$fn__5583$fn__5584.invoke(core.clj:2734)
        at clojure.core.protocols$fn__7852.invokeStatic(protocols.clj:168)
        at clojure.core.protocols$fn__7852.invoke(protocols.clj:124)
        at clojure.core.protocols$fn__7807$G__7802__7816.invoke(protocols.clj:19)
        at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
        at clojure.core.protocols$fn__7835.invokeStatic(protocols.clj:75)

dnolen16:10:43

@isaac what version of ClojureScript - just seems like you may have a bad module graph

isaac16:10:45

latest version: 1.10.339

isaac16:10:30

clean my output-dir, got a new error:

java.lang.Exception: No input matching "pako"
        at cljs.module_graph$canonical_name.invokeStatic(module_graph.cljc:179)
        at cljs.module_graph$canonical_name.invoke(module_graph.cljc:173)
        at cljs.module_graph$inputs__GT_assigned_modules$canon__4705$fn__4706.invoke(module_graph.cljc:216)

dpsutton16:10:02

don't know if its relevant but does this happen with :parallel-build turned off?

isaac16:10:12

is :parallel-build enabled default?

dpsutton16:10:58

I don't think so

isaac16:10:24

I'm not set :parallel-build explicit

dpsutton16:10:44

I've had circular dependency issues that are hard to diagnose when that was turned on.

dpsutton16:10:53

Just thought I would mention it

isaac16:10:33

I checked my cljs file, all things ok. is the circular requires in js files will cause throws too?

isaac16:10:45

I also have some confusions -- why cljs compile my other files that my main ns not required.

dnolen17:10:47

I thought we resolved :parallel-build circ dep issues in the latest releases

dnolen17:10:28

@isaac anyways I don’t think that has anything to do w/ your problem

dnolen17:10:44

the error tells you that you’ve specified some entry but no source file exists

dnolen17:10:09

this looks like NPM stuff

dnolen17:10:32

you’re not listing those in your entries are you?