struct Bar {
name: str;
}
struct Baz {
name: str;
}
trait Foo {
func fooBar();
}
impl Foo for Bar {
func fooBar() {
println("foobar method in foo for bar %s!", name);
}
}
impl Foo for Baz {
func fooBar() {
println("foobar method in foo for baz %s!", name);
}
}
// attributes look cool
// basically generics, we need to use
// them in this case instead of saying `value: Foo` as
// a param, because a trait does not have a constant
// size that is known at compile time, so the generic
// will basically compile down to [in this case] two
// functions one for Bar, and one for Baz, then it
// will know the size of the given value.
// this might be weird to understand but its 1am and im
// ill and tired. jah bless xx
func [T: Foo] callFooBar(value: T) {
}
func main() {
// monomorphisation????
baz: Baz = {
name: "baz",
};
bar: Bar = {
name: "bar",
}
callFooBar(baz);
callFooBar(bar);
}
output-filename, input-filename, and the elements of
base-boot-list must be strings.
make-boot-file writes a boot header to the file named by
output-filename, followed by the object code for each
input-filename in turn.
If an input file is not already compiled, make-boot-file compiles
the file as it proceeds.
The boot header identifies the elements of base-boot-list as
alternative boot files upon which the new boot file depends.
If the list of strings naming base boot files is empty, the first named
input file should be a base boot file, i.e., petite.boot or some boot file
derived from petite.boot.
Boot files are loaded explicitly via the --boot or -b
command-line options or implicitly based on the name of the executable
(Section 2.9).
See Section 2.8 for more information on boot files
and the use of make-boot-file.