Skip to content

Question on callNextMethod

3 messages · Simon Knapp, Charles C. Berry, Martin Morgan

#
Simon Knapp <sleepingwell at gmail.com> writes:
Autoprinting has tricked you.
[1] "derived\ncalled"
[1] "base called"
[1] "base called"
HTH,

Chuck

  
    
#
On 11/06/2012 07:03 AM, Simon Knapp wrote:
Fun; I think you're seeing the print command, and also the (normally invisible) 
return value from print

 > d = new('Derived')
 > res = test(d)
[1] "derived called"
[1] "base called"
 > res
[1] "base called"

similar to

 > print("x")
[1] "x"
 > (print("x"))
[1] "x"
[1] "x"

Martin