Arc Forumnew | comments | leaders | submitlogin
3 points by evanrmurphy 1818 days ago | link | parent

Thanks. So when the function name is grouped with its parameters in definition (as it is in scheme), and infix is permitted, no longer does the function name have to come before its parameters.

I would have to get used to not always seeing the function name first, but I like the symmetry this produces between definition and call.

Added: So when wart got infix (, Kartik gave this example for defining your own infix ops:

  def (<>) (a b)
    (~iso a b)
"<>" had to be in parens so that wart's infixey reader wouldn't try to swap it with "def". Now thanks to scheme-style grouping of the function name with its params, this definition can be written:

  def (a <> b)
    (~iso a b)

2 points by akkartik 1818 days ago | link

Exactly. Sorry, I think you're missing In brief, = is now equality and <- is now assignment. And since both are composed of operator chars, (def (a <- b) ..) is transparently read as (def (<- a b) ..), which now maps directly to the scheme-like declaration syntax, etc., etc.

Thanks Pauan for the clarifying comments!