jashkenas/coffee-script — Issue #2100: Remove parentheses on function calls with no parameters
Author: ollym
Created: 2012-02-03 18:01:21+00:00
State: open

It's ugly and such a pain having to do foo.bar() just because the function has no parameters. Can we use the ! operator to call the function? 1 symbol is always easier than 2.

`foo.bar!` => `foo.bar()`

And with existence operator:

`foo.bar!?.baz` is equivalent to `foo.bar()?.baz`

So....

```
Array::empty = -> @length > 0

if array.empty! then throw 'Array is Empty!'
```

I understand this may confuse some ruby developers - but in my option we're already confusing them with the use of ? for the existence operator.

Thoughts?