I want to write code like this:
/*something*/ Fn() { ... }
int main()
{
/*something*/ fn = Fn;
while(fn) fn = fn();
return 0;
}
Is it possible to do this is a fully type safe way? Assume C, C++, D, C#, Java, or any other statically typed language.