News for hackers. Stuff that matters.
Re:Lisp: It's Not About Macros, It's About Read by jhuni on Saturday February 18, 2012 @10:52PM (#3608604)
Math was written on paper long before there were computers. As a result, the use of infix notation was an act of necessity not a calculated decision. Now that we have computers and keyboards we should use prefix notation.
Re:Lisp: It's Not About Macros, It's About Read by CJefferson on Sunday February 19, 2012 @06:02AM (#3609124)
So you think we should teach in schools (from an example above):

(/ (+ (- b) (sqrt (- (* b b) (* 4 a c)))) (* 2 a)) ?

Re:Lisp: It's Not About Macros, It's About Read by burgerbrain on Sunday February 19, 2012 @04:48PM (#3610531)
Seems like a great idea to me.

I take it you think there is something intrinsically wrong with that idea?

Re:Lisp: It's Not About Macros, It's About Read by CJefferson on Monday February 20, 2012 @11:59AM (#3612949)
Certainly, I would hope it would have been obvious, but we might each have different opinions of obvious!

I find it very hard, without bracket counting, to see exactly what the '+' and '/' bind to. With the more traditional:

(-b + sqrt(bb-4ac)) / (2a)

I find in only a glance I can tell what everything is binding to.

Re:Lisp: It's Not About Macros, It's About Read by anamax on Monday February 20, 2012 @05:41PM (#3614274)
> I find in only a glance I can tell what everything is binding to.

It must be nice to live in a world with only 4 infix operators and expressions that have only 3 infix operators.

For example, lots of folks think that sqrt should be a prefix operator, not yet another function. I suppose you're going to assume that the top bar will serve as parentheses.

BTW "-b + sqrt(bb-4ac) / 2a" is the interesting expression. Is it "(-b + sqrt(bb-4ac)) / (2a)" or "-b + (sqrt(bb-4ac)) / 2a)" And, are you certain what "bb-4ac" means? (There's at least one major language where it doesn't mean "(bb)-(4ac)".)

Re:Lisp: It's Not About Macros, It's About Read by CJefferson on Thursday February 23, 2012 @05:29AM (#3624462)
We aren't talking about programming languages. We are talking about teaching math in school. In most of school mathematics, there are only 4 infix operators (well, and also the comparison operators).
Re:Lisp: It's Not About Macros, It's About Read by anamax on Thursday February 23, 2012 @09:46AM (#3625074)
> We are talking about teaching math in school. In most of school mathematics, there are only 4 infix operators (well, and also the comparison operators).

And that's how the exceptions swallow the rule. And, it's also how we get infix programming languages where that's definitely not true, and so on. Where should we make the switch?

Also, only four? What about set operations?

Re:Lisp: It's Not About Macros, It's About Read by jhuni on Monday February 20, 2012 @05:49PM (#3614305)
I would teach it like this:

  (/ (- (sqrt (discriminant a b c)) b)
     (* 2 a))
Re:Lisp: It's Not About Macros, It's About Read by andreasvc on Sunday February 19, 2012 @06:22AM (#3609133)
Why exactly is it a necessity to use infix on paper? And what exactly is the argument for using prefix just because we have computers? I'd argue quite the opposite, computers give use even more convenience to use whatever we like. I think it is a rather arbitrary choice, but it may relate to the prevalence of subject-verb-object in (spoken) languages; i.e., operators act like a verbs.
Re:Lisp: It's Not About Macros, It's About Read by lispm on Sunday February 19, 2012 @12:36AM (#3608745)
if you look at math on paper, that's definitely not 'infix'.