Re: Thoughts on a curly-infix reader macro?

2014-04-07 Thread Simon Brooke
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

Re: Thoughts on a curly-infix reader macro?

2014-04-06 Thread Joshua Brulé
IMO, the times when it makes sense to use infix notation are fairly few, anyway. One could write the above as: (/ (* 2 x1 x2) (+ x1 x2)) I find this a very convincing counter-argument, in general. (I also think the random examples I cooked up were a poor demonstration.) But it

Re: Thoughts on a curly-infix reader macro?

2014-04-06 Thread James Reeves
On 6 April 2014 21:50, Joshua Brulé jtcbr...@gmail.com wrote: But it still seems to me that in the case *exactly three forms* - binary function and arguments - curly infix can be a solid improvement on readability. (map (fn [x] (cond (zero? {x mod 15}) FizzBuzz (zero? {x

Re: Thoughts on a curly-infix reader macro?

2014-04-06 Thread Joshua Brulé
Though if I was going to write the above, I'd probably write: (divides-exactly? x 5) I didn't think of that, and yes, I'd agree that that's better. I think my main problem with this proposed syntax is that it doesn't represent a data structure. And *now *I'm convinced. I was thinking of

Thoughts on a curly-infix reader macro?

2014-04-04 Thread Joshua Brulé
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

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Steve Miner
The desire (and rejection) of infix notation for Lisp is as old as the hills. Therefore we expect future generations of Lisp programmers to continue to reinvent Algol-style syntax for Lisp, over and over and over again, and we are equally confident that they will continue, after an initial

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Jason Felice
Odd-entry-count maps would have corner cases: One would need to use an even number of unary operators. If an odd number of unary operators were used, what looked like a valid expression would become a map, and that might be hard to figure out. Also, since the order of entries in a map is not

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Alex Miller
Incanter supports this with the $= prefix: ($= 7 + 8 - 2 * 6 / 2) http://data-sorcery.org/2010/05/14/infix-math/ Might be worth looking at... On Thursday, April 3, 2014 11:17:32 PM UTC-5, Joshua Brulé wrote: Proposal: For an *odd* number of forms a, x, b, ... {a x b x c ...} = (x a b c

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread James Reeves
Why bother with a reader macro, when you can use a normal macro? (infix (2 * x1 * x2) / (x1 + x2)) IMO, the times when it makes sense to use infix notation are fairly few, anyway. One could write the above as: (/ (* 2 x1 x2) (+ x1 x2)) Which to me actually seems more readable

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Michael Fogus
I prefer Unfix -- http://fogus.me/fun/unfix/ ;-) On Fri, Apr 4, 2014 at 12:45 PM, Alex Miller a...@puredanger.com wrote: Incanter supports this with the $= prefix: ($= 7 + 8 - 2 * 6 / 2) http://data-sorcery.org/2010/05/14/infix-math/ Might be worth looking at... On Thursday, April 3,

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Alex Miller
I knew there was another one out there, but couldn't remember whose... ! Thanks... On Friday, April 4, 2014 2:36:59 PM UTC-5, Fogus wrote: I prefer Unfix -- http://fogus.me/fun/unfix/ ;-) On Fri, Apr 4, 2014 at 12:45 PM, Alex Miller al...@puredanger.comjavascript: wrote: Incanter