I think this comes down to learning to speak Lisp.

Everyone's first few months of learning to speak Lisp are painful. And then 
quite suddenly it becomes natural. Yes, it's possible to write infix 
notation for Lisp - I first saw this in InterLisp's CLISP (I think) back in 
1985 or so, but it's older than that. Lots of people have implemented it, 
virtually no-one uses it. Because once you've learned enough Lisp to 
implement the macro, you've learned to speak Lisp; and once you've learned 
to speak Lisp, infix notation no longer seems natural.



On Friday, 4 April 2014 05:17:32 UTC+1, Joshua Brulé wrote:
>
> Proposal:
>
> For an *odd* number of forms a, x, b, ...
>
> {a x b x c ...} => (x a b c ...)
> {a x b y c ...} => (*nfx* a x b y c ...)
>
> Reasoning:
>
> Even after a lot of practice, prefix math is still harder (at least for 
> me...) to read than non-prefix math. The [], () and <> matching delimiters 
> are already taken, but {} is only used for an even number of forms (and, in 
> fact, throws an exception on an odd number of forms.)
>
> ; trumped-up examples
> (defn harmonic-mean [x1 x2]
>   {{2 * x1 * x2} / {x1 + x2}})
>
> (defn fib [n]
>   (cond
>     {n = 0} 1
>     {n = 1} 1
>     :else {(fib {n - 1}) + (fib {n - 2})}))
>
> Basically, I'm claiming a solid win on readability, and no risk of 
> breaking any existing code.
>
> I realize there's a certain risk of mistaking curly-infix for a map 
> literal when reading code, but I think it's minimal. To me, at least, {x + 
> y} just doesn't look like a map.
>
> Thoughts?
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to