fabriquer / fabrique

A build description language
Other
3 stars 1 forks source link

method binding #8

Open trombonehero opened 9 years ago

trombonehero commented 9 years ago

We could implement method binding a bit like Go:

foo:InterfaceName = struct
{
    method = function(self:InterfaceName, x:int, y:int) { ... };
    data = ...
};

bar = foo.method(1, 42);
trombonehero commented 9 years ago

This would be extremely cumbersome without interface types (Issue #2), unless we reserved the name 'self' or 'this' and deduced its type...