mozilla/sweet.js — pull request #245 by disnet (2014-02-07 02:01:23+00:00)
Title: honu-style operators

Work in progress at the moment but I wanted to get feedback on syntax. The honu syntax looks like:

```js
// binary_operator
// unary_operator
binary_operator raise 10 left {
function (left, right) {
syntax(pow(left, right))
}
}
```

Some ideas using our syntax:

```js
binary_operator raise 10 left ($left, $right) {
return #{Math.pow($left, $right)}
}
// $left and $right are implicit (or $lhs, $rhs)
binary_operator raise 10 left {
return #{Math.pow($left, $right)}
}
// could decide binary vs. unary by existence of assoc operator
operator raise 10 left {
return #{Math.pow($left, $right)}
}
operator neg 10 {
return #{-$op}
}
// using arrow
operator raise 10 left { $lhs, $rhs } => {
return #{Math.pow($lhs, $rhs)}
}
// haskelly way (too terse IMO)
infixl 10 raise {
return #{Math.pow($left, $right)}
}
left operator 10 {
return #{Math.pow($left, $right)}
}
```

Any other ideas?