> Removing parens doesn't solve the problem with (+ 1 2). For writing out math > formulas a macro that allows infix notation would be useful (and I'm pretty > sure I've seen at least one).
A long time ago I worked for a company that for reasons I will not go into now, wanted to distribute a modified version of CLIPS to its customers that did not resemble LISP syntax. Taking care of things like (printout t "foo") was a simple matter of forcing the parser to recognize it as printout(t "foo"). Piece of cake. The harder problem of course was that (+ 1 2 3) became +(1 2 3) which was even more unacceptable to the customer. Therefore, we added a special null function to the parser that took a bunch of symbols representing an infix mathematical expression and converted it to function calls: (1 + 2 + 3) => +(1 +(2 3)) or (1 + (6 / 3) + 3) => +(1 /(6 3) 3) and so on... It required every math expression to be enclosed in parens, but they didn't care; it was a hit. Weird. I am not encouraging an alternate syntax for Clojure (or Lisp), only stating that turning an s-expr based language into something that vaguely resembles a c-syntax language is not that difficult, even for math expressions. -m --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---