EMGroup/js-eden — Issue #1: Calling undefined functions
Author: itsmonktastic
Created: 2011-11-06 22:24:26+00:00
State: open

In tkeden if we define an observable in terms of something that doesn't yet exist, e.g.

```
a is f(2);
b = 10;
```

Then a takes the value `@`, and the next line causes `b` to take the value 10.

In JsEden the first line causes an type error when trying to call the value "undefined" as a function, so b remains undefined after attempting to execute these statements.

This can be fixed by changing the translator to use a higher order function for function calls so the following eden code:

```
f(2);
```

is translated to JavaScript like so:

```
call(f, 2);
```

`call` would then return `undefined` in cases where `f` were undefined.

Dealing with a chain of potentially failing operations might be more generalisable (basically Maybe monad!) but for now this would be cool.