From maechler at stat.math.ethz.ch  Wed Apr 20 19:42:41 2005
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Wed Apr 20 19:42:51 2005
Subject: [Rd] Overloading methods in R
In-Reply-To: <BAY17-F3487AE8B0461A5BEC97D08D12B0@phx.gbl>
References: <426674E5.8030705@acm.org>
	<BAY17-F3487AE8B0461A5BEC97D08D12B0@phx.gbl>
Message-ID: <16998.38033.698493.702420@stat.math.ethz.ch>

>>>>> "Ali" == Ali - <saveez@hotmail.com>
>>>>>     on Wed, 20 Apr 2005 15:45:09 +0000 writes:

    Ali> Thanks a lot Tony. I am trying to apply the overloading
    Ali> to the methods created by R.oo package and,
    Ali> unfortunately, R.oo uses S3-style classes; so I cannot
    Ali> use the features of S4 methods as you described. On the
    Ali> other hand, I caouldn't find a decent OO package which
    Ali> is based on S4 AND comes with the official release of
    Ali> R.

Ali, maybe we R-core members are not decent enough.
But we strongly believe that we don't want to advocate yet
another object system additionally to the S3 and S4 one,
and several of us have given talks and classes, even written
books on how to do "decent" object oriented programming 
`just' with the S3 and/or S4 object system.

No need of additional "oo" in our eyes.
Your main problem is that you assume what "oo" means {which may
well be true} but *additionally* you also assume that OO has to
be done in the same way you know it from Python, C++, or Java..

Since you are new, please try to learn the S4 way,
where methods belong to (generic) functions more than
to classes in some way, particularly if you compare with other
OO systems where methods belong entirely to classes.
This is NOT true for R (and S-plus) and we don't want this to
change {and yes, we do know about C++, Python, Java,... and
their way to do OO}.

Please also read in more details the good advice given by Tony
Plate and Sean Davis.

Martin Maechler,
ETH Zurich


[Rd] Overloading methods in R
Martin Maechler