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

2015-09-05 Thread Amith George
defun, core.match, tagged vectors - seems like I can emulate Elixir function pattern match behaviour. I took some simple code I found online (https://twitter.com/Xzilend/status/640282621042233344) and rewrote it to 1) use only tagged vectors (not quite) and 2) use defun and tagged vectors. I am

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

2015-09-05 Thread Amith George
In Elixir, tuples are used where in the first element is the tag. A similar thing can be done in Clojure using vectors. That much was clear. What bothered me and prompted me to start this thread was I wasn't sure "what" it is I was doing by creating that vector. Was it purely a convention thing

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

2015-09-05 Thread Timothy Baldridge
>> 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 hack, but it is also an abuse of a data structure. Now when I see [:f

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

2015-09-05 Thread Amith George
> > * Elixir and the BEAM VM are awesome at many things, but I suspect (from > experience not evidence) that the defun version is still faster than the > elixir version. In Clojure, the defun version is not the default or idiomatic way to write functions. I kind of expected it to be slower. M

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

2015-09-05 Thread Amith George
Thanks, it helps to know using a tagged vector is a real pattern :) Gives the confidence to explore this further for my own code. On Saturday, 5 September 2015 22:37:33 UTC+5:30, Gary Verhaegen wrote: > > It won't really help for the library/ecosystem problem, but for your own > code I'd recomm

Re: midje only 1 test

2015-09-05 Thread Brian Marick
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) Then, when you change any text and save the namespace it's in, all tests tha

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

2015-09-05 Thread Rob Lally
Out of interest, I ran the benchmarks as is, and got more or less the same results - 15x. Then I tried upgrading the defun dependencies - clojure, core.match and tools.macro - all of which have newer versions, and then running the benchmarks without leiningen’s jvm-opts and in a trampolined repl

Re: supporting metadata caret reader syntax with deftype

2015-09-05 Thread Mike Rodriguez
I think Artur described it well. I don't think the docs are wrong. The thing is just understanding that the reader macro syntax is interpreted by the reader. The reader comes before the evaluation of the compiler (there is grey area here with read-eval but that's another topic). Since a symbol

Re: supporting metadata caret reader syntax with deftype

2015-09-05 Thread Artur Malabarba
I had the same issue a couple of months ago. The thing to understand is that 'a is NOT a symbol. Actually, it evaluates to a symbol, which is a different thing. When you write ^{:a 1} 'a, it is the same as writing ^{:a 1} (quote a). So the metadata gets applied to the entire form, not the symbol.

AATree release 0.1.0, an indexed sorted map

2015-09-05 Thread William la Forge
Release 0.1.0 provides an alternative to sorted-map, though it also implements the Indexed interface. Written entirely in Clojure, subclassing APersistentMap and validated with collection-check . https://github.com/laforge49/aatree As a newbie I wou

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

2015-09-05 Thread Gary Verhaegen
It won't really help for the library/ecosystem problem, but for your own code I'd recommend watching Jeanine Atkinson's Conj talk from last year: http://m.youtube.com/watch?v=ZQkIWWTygio On Saturday, 5 September 2015, Amith George wrote: > Nice. Hadn't heard of it before. It looks interesting.

[ANN] clasew 0.2.0 - Clojure Applescript Execution Wrapper

2015-09-05 Thread Frank Castellucci
https://github.com/FrankC01/clasew *clasew *- Clojure AppleScriptEngine Wrapper *Intent* - clasew provides an idiomatic Clojure wrapper for Java ScriptManager: specifically apple.AppleScriptManager, as well as providing scriptable applications HOF DSLs. Realizing that the audience for such capa

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

2015-09-05 Thread Amith George
Nice. Hadn't heard of it before. It looks interesting. The criterium benchmark is kinda disappointing though. The pattern matched function took nearly 15x the time of the normal function. Performance aside, in Elixir, there seems to be an established convention for creating the function argumen

[ANN] descjop 0.3.0 Om based app supprt.

2015-09-05 Thread Kazuhiro Hara
descjop v0.3.0 (https://github.com/karad/lein_template_descjop) has just been released today! descjop is a Leiningen template for Web based desktop application with Electron. Features: - add option for Om based desctop application. you can try add "+om" option. ``` $ lein new descjop YOUR_APP

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

2015-09-05 Thread James Reeves
You might want to take a look at defun: https://github.com/killme2008/defun - James On 5 September 2015 at 09:24, Amith George wrote: > Hi, > > I just read a blog post [1] talking about Elixir pattern matching. I was > thoroughly impressed with the way its handled in Elixir. I am posting this >

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

2015-09-05 Thread Amith George
Hi, I just read a blog post [1] talking about Elixir pattern matching. I was thoroughly impressed with the way its handled in Elixir. I am posting this here cuz I got rather excited and wanted to discuss this with you all. My experience with pattern matching is limited to the basics of F# and