1. How to define several polymorph constructors and functions like

```
function Add( x, y : Integer ) : Integer;
begin
    Add := x + y
end;

function Add( s, t : String ) : String;
begin
    Add := Concat( s, t )
end;

begin
    Writeln(Add(1, 2));
    Writeln(Add('Hello, ', 'World!'));
end.

```

Can I do this only by case decission like

```
A<-setRefClass(Class = "A"
              ,fields = list(var1="character")
              ,methods = list(setFields=A.setFields
                             ,initialize=function(var1) {
                                if(isClass(var1,"B"))
                                   .self$var1<-as.character(var1$getFields("var1"))                                  
                                else{
                                  .self$var1<-as.character(var1)
                                }
                                .self
                              })
)

```

1. How to combine functional programming with objectorientated prgramming. So if I would call the functions getFields(vecB), where vecB is a vector or list of objects B. The return should be the values of each object? 

```
 B.getFields<-function(...,values){ 
   vars<-mget(names(.refClassDef@fieldClasses), envir = attr(.self, ".xData"))
   if(missing(values)) 
     return(vars)
   if(length(vars)==1)
     return(vars[[1]])
  return(vars[names(vars) %in% values])
  }

     B<-setRefClass(Class = "B"
               ,fields = list(var1 = "character")
                 )

```
2. How to debug e.g. the function initialize from class A? I tried 

```
A$trace("initialize")
a<-A$new("ABC")
initial<-a$initialize
trace(initial,browser,where=A)

```

but it doesnt work.