Just don't do it, surely? (was RE: [R] Retrieve ... argument values)
Simon Fear
Simon.Fear at synequanon.com
Wed Sep 17 18:25:55 CEST 2003
Tony, I don't understand what you mean. Could you give
an example?
> -----Original Message-----
> From: Tony Plate [mailto:tplate at blackmesacapital.com]
> > ... I'm not saying "never write functions that use ...",
> >I'm just saying "never write functions that depend on a particular
> >argument being passed via ...".
>
> Several reasons for not following that principle involve proliferation
> of
> defaults -- if the lower level functions have defaults, then those
> defaults
> must be repeated at the higher levels.
> This is a good reason for not
> following that principle, because it makes software maintenance more
> difficult.
I don't think I agree with that (though maybe I just didn't
get it). I prefer to know what arguments a function is going
to use.
> Another reason for not following that principle is that tf
> you
> have several lower level functions with different default
> values for an
> argument of the same name, it becomes impossible to get the
> lower-level
> default behavior.
I'm lost there. When I choose which function to call it has
its own default??
I often call a function of mine called timepoints.summary for which I
want
to pass graphical parameters to boxplots, matplots and confidence
interval plots. So I name the arguments cex.boxplot, col.boxplot etc
and then within the function I call boxplot(x, cex=boxplot.cex) and so
on. I wouldn't expect a single argument "cex" to magically work out
whether it was being used in a boxplot or matplot and change
to a different default??
Simon Fear
Senior Statistician
Syne qua non Ltd
Tel: +44 (0) 1379 644449
Fax: +44 (0) 1379 644445
email: Simon.Fear at synequanon.com
web: http://www.synequanon.com
Number of attachments included with this message: 0
This message (and any associated files) is confidential and\...{{dropped}}
More information about the R-help
mailing list