Is there an easy way for s/keys spec to work against both qualified/unqualiffied keys at the same time?

2016-10-13 Thread Ikuru Kanuma
Hi, I was reading the official spec guide's explanation for the s/keys macro, played around with it a bit, and was a little surprised that the :req and :req-un are exclusive specs as illustrated below: (ns my.ns (:require [clojure.spec :as s])) (s/def ::some-number int?) (s/def

Re: WAT: JavaScript & Ruby

2016-10-13 Thread Alan Thompson
I cannot think of anything in Clojure as crazy as the stuff in the video; 90% of the stuff in Clojure is a big, big improvement over Java, et al. And a good chunk of that 90% is simply brilliant. Having said that, there are a few WAT type things in Clojure, from small annoyances like the presence

Love the Medley library :)

2016-10-13 Thread Alan Thompson
I had nearly forgotten all of the very convenient functions in the Medley library until I was reminded by a small mention in the Clojure Cheatsheet . It allows you to

Re: core.async top use cases

2016-10-13 Thread Timothy Baldridge
Yeah, I used to do that, but once core.async came out I started to desire the back pressure aspects of channels. I don't think I've used agents for logging since. You always run the risk of something backing up the queue of the agent and causing your thread to crash when it runs out of memory. On

Re: core.async top use cases

2016-10-13 Thread Mark Engelberg
I always found it a bit ironic that my main use case for agents doesn't really at all make use of the "mutable ref" aspect of the agent, only the queue piece. I usually hold the name of the log file in the mutable ref to emphasize that the agent is "guarding" this particular log file, but I don't

Re: core.async top use cases

2016-10-13 Thread Mark Engelberg
My primary use case for agents has always been when I want to coordinate multiple threads writing to a log file. The agent effectively serializes all the write requests with a minimum of fuss. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: core.async top use cases

2016-10-13 Thread Alex Miller
The other other special feature of agents is that the stm knows about them so it's a safe way to have a side effect occur in an stm transaction (all agent sends are delayed till the txn succeeds). I've found that to be pretty handy in advanced usage. -- You received this message because you

Re: core.async top use cases

2016-10-13 Thread Timothy Baldridge
Agents combine two things 1) a queue of functions, 2) mutable state. The key thing about agents is that they still respect Clojure's concept of "instant deref". That is to say, you can always deref an agent even if the queue is backlogged. This is one of the key differences between agents and

Re: core.async top use cases

2016-10-13 Thread Timothy Baldridge
>> When using clojurescript, adding async really increases the load time. That's one place where you might want to use agents when you can. But Clojurescript doesn't support agents. On Thu, Oct 13, 2016 at 7:16 PM, William la Forge wrote: > On Thursday, October 13, 2016 at

Re: core.async top use cases

2016-10-13 Thread William la Forge
On Thursday, October 13, 2016 at 3:38:16 PM UTC-4, larry google groups wrote: > > So when to use agents? I've looked through Clojure repos on Github, > looking for uses of agents, and I found very few. (I was writing a blog > post about concurrency in Clojure, and I found that agents are among

Re: Should I switch to Clojure after 3 years of learning another full stack ?

2016-10-13 Thread Paul Gowder
Another thing worth thinking about is that Cojure(script) is great for pure front-end applications ("single page applications"). The reagent library is a scarily magical way of just abstracting away the dom, and figwheel is a scarily effective build tool. This template is a convenient way to

Re: Should I switch to Clojure after 3 years of learning another full stack ?

2016-10-13 Thread Gregg Reynolds
On Oct 13, 2016 12:59 AM, "Mars0i" wrote: > > Others have meatier, more detailed answers. Here's one more factor that might matter: > > Clojure makes me happy. I'm happier programming in Clojure than in other languages that are also very suitable for my projects. I enjoy

Re: WAT: JavaScript & Ruby

2016-10-13 Thread larry google groups
> Waiting for the Clojure and Scala version. :-} But there won't be. Not ever. Not really. The reason I prefer Clojure over Javascript or Ruby is because so much care and thought went into the APIs of Clojure's core structures and syntax. If you try really hard, you can find the occasional

Re: core.async top use cases

2016-10-13 Thread larry google groups
> It is not just convenience. For example agents don't provide functionality like buffering, back pressure > and select aka alts. If you send an action to an agent you don't get to know when it's done or > to choose what to do if it is currently busy. So when to use agents? I've looked

Re: Diffing clojure data structures faster

2016-10-13 Thread Alex Miller
On Thursday, October 13, 2016 at 12:23:21 PM UTC-5, Dan wrote: > > Hi > > I would like to be able to take advantage of the tree structures > underneath e.g. hash-maps for a faster diff. > > I wrote a gist to do this in clojurescript >

Re: Keywords with colon on the backside?

2016-10-13 Thread larry google groups
Am I correct in saying that this conversation is at least partly related to the question of "Will Clojure ever support reader macros?" And for now the answer is "no". Because with reader macros, programmers could change the meaning of ":". On Friday, September 23, 2016 at 7:13:30 PM UTC-4,

Diffing clojure data structures faster

2016-10-13 Thread Dan
Hi I would like to be able to take advantage of the tree structures underneath e.g. hash-maps for a faster diff. I wrote a gist to do this in clojurescript https://gist.github.com/danjohansson/add5515b2067b3036044d450cbec08f3 I guess BitmapIndexedNode etc are implementation details of

Re: [ANN] permissions - role & permission based access control

2016-10-13 Thread adrian . medina
My suggestion of a bitmask was just a response to a suggestion of prime factorization for encoding roles in an integer. I think using a set is just fine. The space requirements for a small set of keywords is negligible in the larger scheme of things. It also permits more readable code (always a

Re: [ANN] permissions - role & permission based access control

2016-10-13 Thread Torsten Uhlmann
It might be premature optimization, or you could view it as a different approach, for a different usage scenario. I'm myself pretty content with the literal approach, we're using this in a fairly large application and haven't experienced any problems with regards of performance or amount of data

{ANN}} Carmine-sentinel: connect redis by sentinel, make carmine to support sentinel.

2016-10-13 Thread dennis zhuang
Hi, all I wrote a library to make carmine support redis sentinel : https://github.com/killme2008/carmine-sentinel Someone may want to try it if you are interested. It's a beta release, feedback is welcome. -- 庄晓丹 Email:

Re: AOT classes with clj files on classpath causing ClassNotFoundException

2016-10-13 Thread Piotr Bzdyl
Thank you all for the replies - now I understand where the problem comes from. Best regards, Piotr -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

Re: [ANN] permissions - role & permission based access control

2016-10-13 Thread Stefan Kamphausen
Hi, Doesn't that feel like premature optimization to you, too? Bitmasks are much harder to read than sets with spelled out roles and I wonder if the performance gain is really worth that. And it poses a limit of 64 roles. I have seen several enterprise applications that had far more than 64

Re: Should I switch to Clojure after 3 years of learning another full stack ?

2016-10-13 Thread Mars0i
Others have meatier, more detailed answers. Here's one more factor that might matter: Clojure makes me happy. I'm happier programming in Clojure than in other languages that are also very suitable for my projects. I enjoy myself more, and it's easier. I even prefer to use Clojure when I