[FLR-list] Plurals

iago.mosqueira-sanchez at jrc.ec.europa.eu iago.mosqueira-sanchez at jrc.ec.europa.eu
Fri Oct 14 11:34:08 CEST 2011


The mechanism to make getPlural extendible could be for it to become a 
method, dispatched on an objedct of the singular class, that returns the 
name if the FLlst class

setMethod("getPlural", signature(object="FLSAM"),
   function(object)
     return("FLSAMs"))

The only issue with this is that we are creating another copy of a 
(maybe) large object, for a very simple operation. But that's life in 
the OOP world



Iago


On 10/14/2011 09:25 AM, Iago Mosqueira wrote:
> Hi
>
> We looked at ways of making it generic and it wasn't obvious. We could
> have a function defined for each class that when called with a class
> name or object returns the plural for it. I can give it a go at some
> point soonish
>
> Iago
>
> On Friday, 14 October 2011, Laurie Kell <lauriekell at googlemail.com
> <mailto:lauriekell at googlemail.com>> wrote:
>  > look at class.R in FLAdvice to see how it was done for FLBRPs.
>  > I guess the easiest solution would be to make a generic method to
> create all the plurals.
>  > Laurie
>  >
>  > On Fri, Oct 14, 2011 at 2:53 AM, Mark Payne <mpa at aqua.dtu.dk
> <mailto:mpa at aqua.dtu.dk>> wrote:
>  >>
>  >> Hi,
>  >>
>  >> I would like to create some plural classes for FLSAM - specifically,
> FLSAMs and FLSAM.controls. Is there anything special that needs to be
> done at the FLCore level - in particular,  I'm thinking of the
> getPlural() function, which I'm assuming can't be modified that easily
> from the FLSAM package...
>  >>
>  >> Mark
>  >> _______________________________________________
>  >> flr-list mailing list
>  >> flr-list at flr-project.org <mailto:flr-list at flr-project.org>
>  >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list
>  >
>  >
>
>
>
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list


-- 
Dr Iago Mosqueira

European Commission – Joint Research Center
Institute for the Protection and Security of the Citizen (IPSC)
Maritime Affairs Unit FISHREG – Scientific Support to Fisheries
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy

Office : +39 0332 785413
Fax: +39 0332 789658

iago.mosqueira at jrc.ec.europa.eu

http://fishreg.jrc.ec.europa.eu/home



More information about the flr-list mailing list