Hi,
 
I started creating a small class but I'm courious about how it is working.
 
To create a instance of my class "Partri" I write this at Rgui:
x <- new("Partri", name="Gilvan")
 
and to change the slot "name" of this instance, I write:
setName(x, newname="Justino")
 
It is not working, because when I type "x" at Rgui, it shows the initial value, which was "Gilvan". What I am doing wrong?
 
I'll appreciate any king of help!
Gilvan
 
 
# Classe para representar um parâmetro
setClass("Partri",
   # parâmetros
   representation( name="character"),
   # seção de inicialização
   prototype( name="undefined name" )
)

setGeneric("setName",
           function(object, newname,...)
           standardGeneric("setName"))
setMethod("setName", 
          signature(object="Partri",newname="character"),        
          function(object, newname)
          {
            object@name = newname
          }
          )


		
---------------------------------

ora!
	[[alternative HTML version deleted]]


