kraftwerk1611 wrote
do draw()
generates the following output
call Square.draw 1
Where does this one come from, when there is no expression inside draw() ? Is it due to 'this' ?
You are correct. Methods always get 'this' as argument 0.
The syntax of the function call determines what type of subroutine is being called, and what is passed as 'this':
do fun()
method call -- only valid from within a method or constructor; passes current 'this' as 'this' argument.
do object.fun()
method call -- passes object as 'this' argument.
do Class.fun()
function or constructor call -- there is no 'this' argument.
--Mark