Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,23 @@
include "cowgol.coh";
# Only functions that implement an interface can be passed around
# The interface is a type and must be defined before it is used
# This defines an interface for a function that takes no arguments
interface Fn();
# This function repeats a function that implements Fn
sub Repeat(f: Fn, n: uint32) is
while n != 0 loop
f();
n := n - 1;
end loop;
end sub;
# Here is a function
sub Foo implements Fn is
print("foo ");
end sub;
# Prints "foo foo foo foo"
Repeat(Foo, 4);
print_nl();