fabriquer / fabrique

A build description language
Other
3 stars 1 forks source link

Named interfaces #2

Closed trombonehero closed 9 years ago

trombonehero commented 9 years ago

We need to be able to define interfaces. The syntax might look like:

Toolchain:type = struct[
    cc:(list[file])=>list[file],
    cxx:(list[file])=>list[file],
    # etc.
];

or

Toolchain:type = interface {
    cc:(list[file])=>list[file];
    cxx:(list[file])=>list[file];
    # etc.
};

Usage would then be:

bootstrap:Toolchain = struct {
  cc = clang.cc;
  cxx = clang.cxx;
};

do_some_stuff = function(toolchain:Toolchain, config:Foo) { ... };
trombonehero commented 9 years ago

Commit 920aff07323f5ccf20eed319094ef0291753da84 will help with part of this: we can now cast a structure to a supertype.