I have the following Chapel code.
proc update(x: int(32)) {
return 2*x;
}
proc dynamics(x: int(32)) {
return update(x);
}
writeln(dynamics(7));
I would like to send some kind of callback to dynamics, like
proc update(x: int(32)) {
return 2*x;
}
proc dynamics(x: int(32), f: ?) {
return f(x);
}
writeln(dynamics(7, update));
Is this possible? Are there examples I could browse?