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

2015-09-07 Thread Thomas Heller
FWIW before I came to Clojure I did a lot of Erlang and in the beginning I was at the exact same spot wanting to use pattern matching everywhere because it is so damn cool. Same goes for tagged literals. After a little while I realized that it is just not the way to do it in Clojure and

usage of "and"

2015-09-07 Thread Alex Miller
Looks like a typo - these things happen. :) If you file it here we will get updated in the ebook (not sure yet how often that will update): https://pragprog.com/titles/vmclojeco/errata -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

usage of "and"

2015-09-07 Thread jongwon.choi
Typo? (and cnt (pos? cnt)) -- 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 moderated - please be patient with your first post. To unsubscribe from

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

2015-09-07 Thread Amith George
> > Looking at the "(defn register [...])" example. Where is the problem with > the first solution? It doesn't have the bugs the other implementations have > and is extremely simple to reason about? The other two solutions do the > exact same thing just slower with absolutely no gain. If you

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

2015-09-07 Thread Thomas Heller
> > > (def Recipient >> (s/either PlaceHolder >> Existing >> OneOff)) >> > > This looks interesting. Where would I actually use this? I mean, if I have > created three records, I may as well implement multi methods or protocols, > right? Even if I don't do those, I

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

2015-09-07 Thread James Reeves
On 7 September 2015 at 13:59, James Reeves wrote: > On 6 September 2015 at 15:38, Timothy Baldridge > wrote: >> >> As far as performance goes, this is normally the sort of thing that gets >> baked into an app at a pretty low level, that's why I

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

2015-09-07 Thread James Reeves
On 6 September 2015 at 09:57, Amith George wrote: > > Could you elaborate on what you mean by variants being like a key value > pair? > I mean that tags are usually used to describe what the data *is*, whereas keys are usually used to describe what the data is for. For

Re: Uberjar woes

2015-09-07 Thread Fenton Travers
I've had this problem too. I solved in a slightly different way. I had my main function in a clojure file that also defined a component. I moved my main function into a different file and that did the trick. I didn't need a :gen-class directive in each file that had a component. I didn't

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

2015-09-07 Thread Timothy Baldridge
>> Should be expressed as: >> (swap! :atom a, :function inc) One of Rich's talks on simplicity actually addresses that. He states that the above method (with keyword arguments) is actually simpler, but that this isn't exactly easy to program. And yes, I would take this same position about

add concurrency feature as language spec.

2015-09-07 Thread Renjith Thankachan
I have seen clojure now has different platform implementation.It would be good if its concurrency spec. must be a language style spec. like "go" ing Golang. Clojure-CLR,Clojure-Java,Clojurescript need a common concurrency spec. -- You received this message because you are subscribed to the

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

2015-09-07 Thread dennis zhuang
Thanks for your benchmark. I will upgrade all the dependencies and release 0.2.0 We are using defun with instparse in a DSL implementation, the performance is acceptable, but the code is much more readable. 2015-09-06 4:33 GMT+08:00 Rob Lally : > Out of interest, I ran

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

2015-09-07 Thread Amith George
>> I probably wouldn't use protocols since I doubt there is a function signature that is exactly identical for all branches. Each branch probably needs access to different parts of your system (eg. database) and always passing everything to everything is not ideal. >> Multi-Method is great if

Re: usage of "and"

2015-09-07 Thread Lee Spector
> On Sep 7, 2015, at 7:58 AM, jongwon.choi wrote: > > Typo? > > (and cnt (pos? cnt)) Sometimes this kind of thing is reasonable if cnt might be nil, which would break pos?. So the expression says "cnt isn't nil (or false) and it's positive." -Lee -- You

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

2015-09-07 Thread James Reeves
On 6 September 2015 at 15:38, Timothy Baldridge wrote: > >> 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

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

2015-09-07 Thread James Reeves
On 7 September 2015 at 15:49, Timothy Baldridge wrote: > > Types are good even in dynamic languages, we should use the more. As > mentioned by Thomas, records are the idiomatic way to store typed > information in Clojure. > I don't think that's true. Or rather, I think it

Re: add concurrency feature as language spec.

2015-09-07 Thread James Reeves
You mean like core.async? - James On 7 September 2015 at 16:49, Renjith Thankachan wrote: > I have seen clojure now has different platform implementation.It would be > good if its concurrency spec. must be a language style spec. like "go" ing > Golang. >