Since i have just made my foray into R, I came across the following set of function calls:
myFunc<-function(x=matrix())
{
temp<-NULL
set<-function(y)
{
x<<-y
temp<<-NULL
}
get(){ x }
setT(t){ temp<<-T }
getT(){ Temp }
list(set=set,get=get,setT=setT,getT=getT)
}
In the Second function with the following header:
anotherFunc<-function(x)
There is a statement that reads,
randomvariable<-x$getT()
Now what i'm trying to understand is how is this statement different from any other function call. What are the implications of referencing x to call the function getT(). Is there any similarity between the call by reference used in Java, C++?
PS- In case there is mistake in the question format, please do mention since i'm new to SO.