Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
enum FnNames {
PRINT,
ADD,
SOME_FN,
}
struct Fn {
enum FnNames name;
}
Object some_fn(arg1, arg2)
{
return arg1 + arg2;
}
Object invoke(fn, arg1, arg2)
{
switch(fn.name)
{
case(SOME_FN) {
return some_fn(fn, arg1, arg2);
}
case(PRINT) {
println(arg1)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.