Anonymous user
Respond to an unknown method call: Difference between revisions
m
→{{header|M2000 Interpreter}}
Line 722:
}
\\ modules, functions numeric and string, and variables can use same name
\\ here we have module invoke,
Module invoke (&a, method$) {
param=(,)
Line 735:
call "."+method$, !param
}
} else Flush : Error "
}
Function invoke (&a, method$) {
Line 747:
=Function("."+method$, ![])
}
} else Error "
}
\\ invoke string functions
Line 761:
=Function$("."+method$, ![])
}
} else Error "
}
Line 775:
\\ this method has a weak reference to obj, so anytime we use This. or just dot, this weak reference make the real name to execute
Obj.a 10,20
\\ call the fake method (can't access object methods
obj.alfa 10, 20
Line 781:
\\ to check if a method (module) exist, we have to compare this object with other temporary object
\\ we make one with the method name and empty definition, and then check if obj has anything this temp object has
\\ arguments passed in a tuple (optional), so we didn't leave stack with unused items, if we have an
invoke &obj, "a", (10, 20)
invoke &obj, "NoParam"
|