Since functions are basically macros, it would make sense to have a data type for function arguments that can be any type that works with the code.
fn sum(dyn stack, i16 r) {
r = 0;
cell x = 0;
while stack.len {
pop(stack, x);
add(r, x);
}
}
Or, there could be a type abstraction system (would fit with #43)
generic stack {
cell len,
fn push(),
fn push_d(),
fn unshift(),
fn unshift_d()
fn pop(),
fn shift()
}
fn sum(stack s, i16 r) {
r = 0;
cell x = 0;
while s.len {
s.pop(x);
r.add(x);
}
}
Since functions are basically macros, it would make sense to have a data type for function arguments that can be any type that works with the code.
Or, there could be a type abstraction system (would fit with #43)