mixed fixes for fixedfunction

1. create template function for toInt()
2. make sure the submat interpretation match the function signature
3. fix semantic analysis, and make sure the funccallexpr can be other fixed function.