marianoguerra/efene — Issue #48: Feature request: Function calls without parens
Author: DavidMikeSimon
Created: 2011-12-19 20:14:21+00:00
State: open

This one might be tricky to implement in the parser, but I'd be super pleased if Efene had it. It makes a lot of Ruby code so much more readable, particularly when writing domain-specific languages.

The basic idea is that this:

```
some_function foo, bar
```

Should be equivalent to this:

```
some_function(foo, bar)
```

This would only work at the statement level in Efene. In Ruby, you can nest paren-less function calls inside other paren-less function calls, although you shouldn't since it is in confusing to read. But with Efene, that wouldn't even be possible, because Erlang and Efene syntax doesn't distinguish at the lexing level between a call to a function named x and a symbol/atom named x.

Besides making simple statement calls more readable, this syntax is especially nice because it allows you to create functions that look and act like language-level control structures. For example, I could write in Ifene a function to repeat an action X times:

```
repeat = fn(N, Proc)
if N <= 0
ok
else
Proc()
```

And use it like this:

```
repeat 5 fn
io.format("Intruder Detected!")
```