corriep wrote:
I have run into this problem before also. There is no real work-around but in your case you could just make the hungry variable public instead of using a function to access it
There is no limitation for what the OP is trying to do. He forgot the parentheses in the function call, it is the same as doing this, which will also give you an error:
Turing: |
fcn x () : int
result 3
end x
put x |
The limitation you're talking about is trying to use a class subprogram as a subprogram variable or subprogram argument. That is not what the OP is doing, but the compiler thinks that is what he's doing since he forgot the parentheses (and his function is a class subprogram).
Just do this : Turing: |
if monster (i) -> isHungry () then |