Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-10 Thread Ambrose Bonnaire-Sergeant
Hi James, On Wed, Aug 10, 2011 at 5:43 PM, James Sofra wrote: > > Just to clarify, you can extend the matching to new types but the match is > 'closed' in the sense that unlike mutimethods you can't add additional > cases? Is that correct? > > For the 0.1 release, that is correct. In future rele

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-10 Thread James Sofra
Hi David, Looks really neat! Just to clarify, you can extend the matching to new types but the match is 'closed' in the sense that unlike mutimethods you can't add additional cases? Is that correct? Hope that makes sense, James Sofra -- You received this message because you are subscribed to

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Peter Taoussanis
This is great stuff: thank you! I can totally see this being the kind of thing like destructuring, where once you've used it you won't want to go back :) -- Peter -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread David Nolen
On Tue, Aug 9, 2011 at 1:49 AM, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but it's already in a place > where it's fun to play around with and we think some of you might even

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Dienstag, 9. August 2011 15:14:25 UTC+2 schrieb Ambrose Bonnaire-Sergeant: > > On Tue, Aug 9, 2011 at 7:39 PM, David Nolen wrote: > >> Think about code for dealing with macros. >> >> (defmacro foo [& forms] >> (match [forms] >> [(a [x] :else & rest)] ... >> [(a [x b] :else & r

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Ambrose Bonnaire-Sergeant
On Tue, Aug 9, 2011 at 7:39 PM, David Nolen wrote: > Think about code for dealing with macros. > > (defmacro foo [& forms] > (match [forms] > [(a [x] :else & rest)] ... > [(a [x b] :else & rest)] ...)) > > Wow, that is cool! -- You received this message because you are subscribed to

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread David Nolen
On Tue, Aug 9, 2011 at 6:34 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > For those browsing the source, I'll give a quick run through of what's > going on. This means that the machinery is already exposed. There's a bit of code cleanup to do but the pattern matcher is m

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread David Nolen
On Tue, Aug 9, 2011 at 3:50 AM, Sam Aaron wrote: > Exciting stuff! > > Do you happen to have any simple descriptions/examples of where and how we > might use this stuff in our daily programming repertoires? I for one am sure > I'm not educated enough as to the value and utility of pattern matchin

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Sam Aaron
Wonderful. Baishampayan and Ambrose thanks so much for your fantastically lucid examples. I can totally see myself using this stuff. David and Ambrose, it's remarkable work - well done! Sam --- http://sam.aaron.name -- You received this message because you are subscribed to the Google Groups

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Ambrose Bonnaire-Sergeant
For those browsing the source, I'll give a quick run through of what's going on. 1. A "pattern matrix" is built using the given variables and pattern rows. A Pattern row is a pair of matches and a result. Example: match.core=> (build-matrix [x y] [1 0] 0

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Baishampayan Ghose
> On Tue, Aug 9, 2011 at 5:43 PM, Baishampayan Ghose > wrote: >> >> A sample implementation of the `defm` macro used above could be >> something like this (UNTESTED!) - >> *snip* > > `defm` is already at `match.core/defmatch`. Pretty neat :) Lol! I realised that while looking into the match.core

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Ambrose Bonnaire-Sergeant
Hi BG, On Tue, Aug 9, 2011 at 5:43 PM, Baishampayan Ghose wrote: > A sample implementation of the `defm` macro used above could be > something like this (UNTESTED!) - > *snip* `defm` is already at `match.core/defmatch`. Pretty neat :) > I personally believe that David and Ambrose are doing so

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Ambrose Bonnaire-Sergeant
Hi Sam, On Tue, Aug 9, 2011 at 3:50 PM, Sam Aaron wrote: > > > Do you happen to have any simple descriptions/examples of where and how we > might use this stuff in our daily programming repertoires? Think of pattern matching sugar for nested conditionals. For example (match [x y] [1 0

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Edmund
That's a great explanation Baishampayan, thanks ! Edmund On 09/08/2011 10:43, Baishampayan Ghose wrote: >> Do you happen to have any simple descriptions/examples of where and >> how we might use this stuff in our daily programming repertoires? I >> for one am sure I'm not educated enough as to t

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Baishampayan Ghose
> Do you happen to have any simple descriptions/examples of where and how we > might use this stuff in our daily programming repertoires? I for one am sure > I'm not educated enough as to the value and utility of pattern matching - at > the moment I just think "that looks cool" rather than "I'm

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-09 Thread Sam Aaron
ol" rather than "I'm definitely going to use that to do X and Y". Sam --- http://sam.aaron.name On 9 Aug 2011, at 06:49, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread Max Penet
Thanks! This looks really good. I hope this ends up in contrib at some point, also looking forward to its extension (guards & co). On Aug 9, 7:49 am, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread László Török
David, this looks great! sent from my mobile device On Aug 9, 2011 7:58 AM, "Tuba Lambanog" wrote: > Awesome! > > Thanks for the great work. > Tuba > > On Mon, Aug 8, 2011 at 11:49 PM, David Nolen wrote: > >> Ambrose and I have been working on a high perfor

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread Tuba Lambanog
Awesome! Thanks for the great work. Tuba On Mon, Aug 8, 2011 at 11:49 PM, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but it's already in a place > where it's fun to play

ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread David Nolen
Ambrose and I have been working on a high performance pattern matching library for Clojure. There's much left to do but it's already in a place where it's fun to play around with and we think some of you might even find it useful even in this early form. Some highlights: * Literal

Pattern matching library

2009-09-28 Thread Antonio Garrote
Hello everyone. I¹ve been working for a couple of days in a small library for doing pattern matching in Clojure. Although it is just a sketch, is currently working. These are some examples of how to use: >(tuples/match (a b (c d) e) (1 2 (3 4) 5) (+ b e)) 7 >(def *