This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-27
Channels
- # bangalore-clj (1)
- # beginners (50)
- # boot (23)
- # cider (19)
- # clara (28)
- # cljsrn (4)
- # clojure (93)
- # clojure-greece (67)
- # clojure-spec (14)
- # clojure-uk (11)
- # clojurebridge (1)
- # clojurescript (151)
- # community-development (1)
- # core-async (19)
- # core-matrix (1)
- # cursive (3)
- # emacs (1)
- # klipse (5)
- # leiningen (5)
- # luminus (3)
- # lumo (22)
- # nyc (1)
- # off-topic (17)
- # om (12)
- # onyx (16)
- # pedestal (5)
- # re-frame (20)
- # reagent (5)
- # spacemacs (10)
- # uncomplicate (2)
- # unrepl (11)
- # untangled (8)
- # vim (1)
i’m not seeing a way to do this which doesn’t involve a branch statment to check if the value is negative or not.
hmm apparently this has been written about …
hey guys, i’m trying to understand how exactly to use java interop with Enums — specifically, I’m trying to use the java.text.Normalizer.Form
enum… if I have already imported the java.text.Normalizer
, how can I import that ?
I thought that using java.text.Normalizer.Form/NFD
would’ve done the trick, but it generates a ClassNotFoundException… any suggestions ?
I realize from my latest exercises that many functions in clojure are implemented recursively. Isn't recursion slow?
can one set a dependency of a latest version of a library, rather than a named version of it, in leiningen's project.clj
? e.g. for having dev-mode stuff like criterium always current
@vitruvia more often then not, you should see recursion implemented with recur
, which is tail-call optimized.
a call to recur turns into a loop
it is iterative
(loop [x 1] (if (< x 10) (recur (inc x)) x))
is effectively for(x = 0; x < 10; x++){};x;
on a byte code level it should be nearly identical
@matan I don't believe so, but in general options like that (wildcards, globbing, implicit imports) are frowned upon in Clojure.
@matan you can get similar things done though with https://github.com/xsc/lein-ancient using lein ancient upgrade
Note that :only/:exclude compose with the :dependencies/:plugins/:all options - to e.g. only upgrade SNAPSHOTs of plugins you'd use:
$ lein ancient upgrade :plugins :only snapshots
@lilactown Pedestal is more of a kind of framework. Not in a project template kind of way, but in that it has a number of new ideas that it provides, such as interceptors. Luminus is much more of a collection of libraries framework. It's like an opinionated collection of libraries that make up a stack that you might have assembled yourself, had you searched for the best combination of libs. You don't have to build your stack that way, but Yogthos has done a lot of that legwork for you and wrapped it up into a nice package.
Luminus has been out for a while now though, so it might provide a number of tricks of its own, but that's the original design difference between the two, IIRC
It's probably possible to rip out a number of pieces of Luminus and cram Pedestal in there, if you really wanted to.
more likely, put parts of luminus into pedestal?
doesn't Luminus bring in ring/compojure? I'd imagine there's a way to replace those bits with pedestal bits, in principle
thanks @john @noisesmith
@john I don't think pedestal uses ring
it's its own beast
It actually does use a bit of ring, I believe. But yeah, bolting pedestal into luminus' framework might be non-trivial
I moreless bring up the idea to contrast the differences between the two. Might not be a good idea.
oh, it does actually pull in ring-core when I make a new pedestal-app clone
interesting
also using ring means they can use all the libs implemented as ring middleware
yes, luminus is based on ring and compojure
I was surprised pedestal was doing it too haha
question in general about frontend lets say i have users that arent supposed to see some options if they are not logged in should i just hide those in css (display: none) (and prevent action from being made if not logged in) then when they do login change css or something else?
is this a question of things being pretty, or securing data they shouldn't be able to access?
if it's an appearance thing, sure, use display:none
but don't even send the apropriate data if it's about security
basically i'd have functon that 'draws' interface for logged out user and same function for logged in with added options
for my app, we don't even send the cljs code until someone logs in - that keeps it simple
prevents leaking implementation details or accidental data via the code