Created
April 24, 2018 14:25
-
-
Save halgari/1ee370153f1299aaa27ab09ff43c5a1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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