You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
felipensp edited this page Jan 19, 2013
·
30 revisions
This is where we hold a TODO list. We'll try to keep this as much organized as we can...
TODO
SAPI layer
Take a look at asmjit for a native JIT support
Fix PkgManager error handling
Write a manpage for clever interpreter
Implement switch-case control flow
Implement include of clever file
Implement for loop
Implement iterators
Improve current modules
Ideas
Functions and Callable interface
Functions and Callable
Clever functions, as everything that you can put in a variable, are objects. All functions implement the Callable interface under the hood.
The interface Callable is an internal interface but it can be described as:
iface Callable {
public operator()(...args);
}
Utilities
bind(func)
bind(func, ...args) is a function which returns a Callable. Performing a function call in an object returned by bind(), produces the same behavior of calling func(..args):
var min8 = bind(min, 8); // min(x, y) returns x if x <= y is true, y otherwise
print(min8(9)); // 8
print(min8(1)); // 1