Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2015-05-27 Thread Daniel Szmulewicz
A very instructional presentation about pattern matching in general and defun in particular was given by Sean Johnson at Clojure West. https://www.youtube.com/watch?v=n7aE6k8o_BU Recommended watching. On Sunday, September 14, 2014 at 9:47:28 AM UTC+3, dennis wrote: > > > Hi , i am pleased to

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2015-05-25 Thread Jay Porcasi
hi Dennis wow... that's beyond beautiful, it's awesome this makes Clojure even more 'Haskell-ish', which is a good thing in my opinion thanks for sharing this gem with the world Jay On Sunday, September 14, 2014 at 1:47:28 PM UTC+7, dennis wrote: > > > Hi , i am pleased to introduce defun

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-10-23 Thread Max Gonzih
Are there any updates on clojurescript support? On Friday, September 26, 2014 1:00:04 PM UTC+2, dennis wrote: > > I will add supporting for clojurescript this weekend.Thanks for your > suggestion. > > 2014-09-26 1:09 GMT+08:00 Ivan L >: > >> Is this clojurescript ready? This looks amazing, I wou

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-10-10 Thread Mars0i
I think it *is* a beautiful macro. On Sep 14, 2014, at 7:45 AM, adrian...@mail.yu.edu wrote: > > Friendly advice: when you describe anything you create with adjectives > like beautiful, it comes off as unnecessarily arrogant to native English > speakers. > > Adrian > > On Sunday, September 14,

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-26 Thread Andre Richards
Don't think Rich Hickey is a fan of pattern matching, which is probably why it is not in core to begin with. If you watch his "Simple made easy" talk, pattern matching is one of the items listed under *Complexity Toolkit*, with this description: "Complects multiple who/what pairs". I'm not sur

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-26 Thread dennis zhuang
I will add supporting for clojurescript this weekend.Thanks for your suggestion. 2014-09-26 1:09 GMT+08:00 Ivan L : > Is this clojurescript ready? This looks amazing, I would also love to > have it in core. > > On Sunday, September 14, 2014 2:47:28 AM UTC-4, dennis wrote: >> >> >> Hi , i am plea

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-25 Thread Ivan L
Is this clojurescript ready? This looks amazing, I would also love to have it in core. On Sunday, September 14, 2014 2:47:28 AM UTC-4, dennis wrote: > > > Hi , i am pleased to introduce defun : > a beautiful macro to define clojure functions with pattern mat

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-24 Thread Jacob Goodson
I did this same thing and called it defmatch. You can use vinyasa to inject functions into core through leiningen. I did that and it allowed me to have defmatch anywhere I wanted to have it. Anyway, I guess someone else had this idea lol =P. -- You received this message because you are subs

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-23 Thread J David Eisenberg
On Saturday, September 13, 2014 11:47:28 PM UTC-7, dennis wrote: > > > Hi , i am pleased to introduce defun : > a beautiful macro to define clojure functions with pattern match. > > [snip] > This is totally wonderful. Elegant, and useful. -- You received

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-22 Thread Devin Walters
I didn't read it that way. > On Sep 14, 2014, at 7:45 AM, adrian.med...@mail.yu.edu wrote: > > Friendly advice: when you describe anything you create with adjectives like > beautiful, it comes off as unnecessarily arrogant to native English speakers. > > Adrian > >> On Sunday, September 14, 20

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-21 Thread killme2...@gmail.com
I am glad it's helpful.I am using defun to write transform functions for instaparse in a DSL parser,it's really good at it.I am not sure if i can create a pull request to core.match. 发自我的 iPad > 在 2014年9月21日,下午5:13,Max Gonzih 写道: > > Amazing! Would love to have something like that in clojure.

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-21 Thread Max Gonzih
Amazing! Would love to have something like that in clojure.core. On Sunday, September 14, 2014 8:47:28 AM UTC+2, dennis wrote: > > > Hi , i am pleased to introduce defun : > a beautiful macro to define clojure functions with pattern match. > > Some examples: >

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread Henrik Eneroth
For all the good qualities of the Clojure group, it can sometimes produce a bit of a harsh tone. Don't let that get you down though, it's great that you're building stuff and showing it off! As far as defun goes, it looks interesting. The out-of-the-box pattern matching was one of the things I

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread Bozhidar Batsov
Cool idea! I really wish something similar was available out-of-the-box - perhaps it makes sense to include such a macro in core.match itself as some point? — Cheers,  Bozhidar On September 14, 2014 at 9:47:21 AM, dennis zhuang (killme2...@gmail.com) wrote: Hi , i am pleased to introduce defu

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread adrian . medina
Criticism accepted Herwig. I apologize for not doing so initially. On Sunday, September 14, 2014 12:15:36 PM UTC-4, Herwig Hochleitner wrote: > > Hi Dennis, > > marrying core.match to defn is a pretty neat idea. Thanks for releasing it! > > I see that you actually extended defn in that you made i

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread dennis zhuang
And of course ,it still run in constant stack space just like normal recur form. P.S. I think adrian's advice is good, please forgive my poor english,and i changes the description to ' a macro to define clojure functions with pattern match just like erlang or elixir. 2014-09-15 0:26 GMT+08:00 den

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread dennis zhuang
Hi Herwig Actually,defun just define a variadic arguments function,so it doesn't have different arities. And when using defun macro ,it walk through the body forms, find 'recur' forms and replace them with (recur (vector ...arguments)) instead. A macroexpand-1 result of accum: (macroexpand-1

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread Herwig Hochleitner
Hi Dennis, marrying core.match to defn is a pretty neat idea. Thanks for releasing it! I see that you actually extended defn in that you made it possible to recur between different arities. Can you give a quick rundown on how you made that work? Are the arities still separate IFn arities? Does it

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread adrian . medina
Friendly advice: when you describe anything you create with adjectives like beautiful, it comes off as unnecessarily arrogant to native English speakers. Adrian On Sunday, September 14, 2014 2:47:28 AM UTC-4, dennis wrote: > > > Hi , i am pleased to introduce defun

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread dennis zhuang
Released 0.1.0-RC, defun collect :arglists metadata, another recursive function example: (defun accum ([0 ret] ret) ([n ret] (recur (dec n) (+ n ret))) ([n] (recur n 0))) (accum 100) ;; the result is 5050 2014-09-14 14:46 GMT+08:00 dennis zhuang : > > Hi , i am pleased

{ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-13 Thread dennis zhuang
Hi , i am pleased to introduce defun : a beautiful macro to define clojure functions with pattern match. Some examples: (defun say-hi ([:dennis] "Hi,good morning, dennis.") ([:catty] "Hi, catty, what time is it?") ([:green] "Hi,green, what a good day