diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -118,3 +118,34 @@ allowing recursion. We might even want to require that a function can be turned into a 'returning' function (being pretentious we might prefer calling it 'folding' but anyway) so that it can be interfaced from C code, for example. + +### Function calls as arguments + +At the moment, it's a bit cumbersome to directly pass closure arguments to other +functions: +``` +get_some_value() => n; +do_something_with(n) => ... +``` + +If we don't really care about the named variable `n`, it might make more sense +to provide syntactic sugar like +``` +do_something_with(get_some_value()) => ... +``` + +that translates to the same thing as above, with some internal variable 'name'. +This would also require that `get_some_value` has some limitations, like a +single closure argument that consists of a single value. This might be +particularly significant for condition checking, like +``` +// assuming this is the form of if statements, as they're still not in the +// grammar +get_some_value() => cond; +if cond {...} +``` + +versus +``` +if get_some_value () {...} +``` |