Fork me on GitHub

a newbie cljs question: Why is there no float? function? Is there some alternative I should/can use instead?


@pdmct JavaScript numbers are always 64bit floats. Sorry if this doesn't help... what are you trying to test for floatiness?


(number? 1) might be adequate?


I’m trying to write some cljs.spec predicates — some of my data are floats — just thought it was odd that it doesn’t exist — yes I am using number? but that is not as descriptive as I would like


ah cool, yup well I think number? is as good as it gets in CLJS, as there is no finer type... what are you trying to describe?


ok thanks, just some stuff like this

(s/def ::latitude   (s/and number? #(<= -90.00 % 90.00)))     
(s/def ::longitude  (s/and number? #(<= -180.00 % 180.00)))


:thumbsup: I see, nice. Yup seeing there is no other type than float for storage, you can't really be any more strict than that.


got it, thanks


Hi all, newbie question here. What is typically required to add a css framework into a clojurescript project? There are appears to be a lot of “*jar” repositories and it’s confusing me a bit. In particular, I’m trying to add the semantic-ui css framework to a project. Looking through some of the options, it looks like I can either: - Use webjars (but throws an dependency error regarding jquery) - Use clojars (isn’t at the latest version) - Use npm to pull the package and manage it with gulp (not sure how to integrate with clojurescript) Can anybody offer a few pointers?


@odie, you can just add it as a static file and add it to a vendor or assets directory


I'd just commit the .css to the repository and have it served as part of the static files of your project


unless you have a ton of dependencies like this, I feel this frees up a lot of headspace


although I hadn't heard of webjars before, that seems kinda neat


I'm trying to do something seemingly trivial, which is on a textarea field (Reagent) on-input event, get the current scrollHeight... but for some reason this-as is returning this as the window object instead of the textarea object?


[:textarea {:on-input #(this-as my-this (.log js/console my-this))}]


Where am I going wrong here or is there some more idiomatic way to do this in ClojureScript?


I was able to get it from .-target instead, although it seems there should be a way to use this