Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread Amith George
In a possible messaging system, a user could denote a recipient using one of three ways - 1) select an existing user id, 2) enter a new name and email, 3) pick a placeholder "all my team mates". Possible F# (might not compipe!!) Recipient = | Placeholder of string | Existi

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh
Thanks a ton for writing all of this up. I'm actually using Langohr & RabbitMQ as well, so I have the sense that you've solved problems that I might encounter down the road. On Friday, September 4, 2015 at 7:57:21 AM UTC-4, Dave Tenny wrote: > > I'm using components to encapsulate Langohr/Rabbit

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh
On Thursday, September 3, 2015 at 9:15:54 AM UTC-4, Andy- wrote: > > Only to answer the "retry on error" part of you question: You might like > hara/event: > http://docs.caudate.me/hara/hara-event.html > Thanks for the tip! I've been meaning to check out hara anyway. If I end up using it I'll p

Re: Ring Mock and Ring Anti Forgery

2015-09-06 Thread Nicolás Berger
>From the ring-anti-forgery tests [1] I see that it expects the token to be both in the session under the `::af/anti-forgery-token` key and in the `:form-params` in the request as `__anti-forgery-token`, so you can do something like: ``` (require '[ring.middleware.anti-forgery :as af]) (deftest m

usage of "and"

2015-09-06 Thread Jeff Mad
I am reading Clojure Applied, which I am enjoying. One code snippet is puzzling for me, can someone please explain why the authors used: (and (pos? cnt) instead of just (pos? cnt) ? Or to go further, (pos? (item @inventory)) The best I could think is that there used to be a check for two th

Ring Mock and Ring Anti Forgery

2015-09-06 Thread Mathieu
I want to test a compojure webapp, but i don't know how to use Ring-Anti-Forgery inside Ring-Mock. Actually, all my post requests in my test return 403. Any idea ? Thanks -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread Timothy Baldridge
>> I'm not sure why you think that it "complicates the code, and makes it harder to understand". Alright, I'll use the phrase: using vectors as variants complects order with data. If you hand me a vector that says [:name "tim"] I have to know that "the first thing in this vector is the name of the

Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread James Reeves
On 6 September 2015 at 14:41, Timothy Baldridge wrote: > >> "Variants fulfil the same purpose as key/value pairs in a map. The key > denotes a context-sensitive purpose for the data, rather than its type." > > Then use a key/value type. That's my problem with this approach, it > abuses a collecti

Re: AATree release 0.1.0, an indexed sorted map

2015-09-06 Thread William la Forge
Once I started thinking about how to extend this code, I realized that I have used too many methods when implementing IMapNode. As it stands, I would need to duplicate all the code to implement a vector, which is just silly. As aamap already implements Indexed, a vector would mostly just not su

Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread Timothy Baldridge
>> "Variants fulfil the same purpose as key/value pairs in a map. The key denotes a context-sensitive purpose for the data, rather than its type." Then use a key/value type. That's my problem with this approach, it abuses a collection type and therefore creates confusion as to the type of data is

Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread Amith George
TIL that "tagged literals" have an existing meaning in clojure. In my mind, the terms "tagged vector" and "tagged literal" were interchangeable. From a quick Google search there doesn't seem to be an existing meaning for "tagged vector". I think we can agree that it a representation of variants

[ANN] Recent clj/s library updates - September 2015

2015-09-06 Thread Peter Taoussanis
*Sente - v1.7.0-beta2 / 2015 Sep 4 (2 days ago)* *==* *Realtime web comms for Clojure/Script (think Socket.IO for Clojure).* https://github.com/ptaoussanis/sente/releases Notable recent changes: * Switched to Timbre v4 for cross-platform logging * Added support for n

Re: Just found out about Elixirs function argument pattern matching...

2015-09-06 Thread James Reeves
On 6 September 2015 at 02:31, Timothy Baldridge wrote: > >> Thanks, it helps to know using a tagged vector is a real pattern :) > > I don't know that it's a "real pattern". If I saw code like this in > production I would probably raise quite a stink about it during code > reviews. It's a cute hac

Re: midje only 1 test

2015-09-06 Thread Atamert Ölçgen
Hi Brian, On Sun, Sep 6, 2015 at 1:19 AM, Brian Marick wrote: > I *strongly* recommend doing all your testing in a repl buffer. That > given, there are two ways to solve your problem. The first, which I prefer, > is to start by testing everything: > > (use 'midje.repl) > (autotest) > Ot