From bbolker at gmail.com  Wed Jul 17 19:20:56 2013
From: bbolker at gmail.com (Ben Bolker)
Date: Wed, 17 Jul 2013 17:20:56 +0000
Subject: [Rd]
	=?utf-8?q?On_the_mechanics_of_function_evaluation_and_argume?=
	=?utf-8?q?nt=09matching?=
References: <3727EA1A-F2BE-4C1D-9CBB-2BA6F8ED76A7@muxspace.com>
	<CAAmySGOCr5ieKer23OS6hYsyRbKY_WmY-3aK7_N5sBaehwzzNQ@mail.gmail.com>
	<5CC4DF09-7D40-4A0D-BCA4-75C2CEF7E82A@muxspace.com>
Message-ID: <loom.20130717T191900-141@post.gmane.org>

Brian Rowe <rowe <at> muxspace.com> writes:

> 
> Thanks for the lead. Given the example in ?missing though,
>  wouldn't it be safer to explicitly define a
> default value of NULL:
> 
> myplot <- function(x, y=NULL) {
>   if(is.null(y)) {
>     y <- x
>     x <- 1:length(y)
>   }
>   plot(x, y)
> }
> 

 [snip]

 In my opinion the missing() functionality can indeed be
fragile (for example, I don't know how I can manipulate an
existing call to make an argument be 'missing' when it was
previously 'non-empty') and using an explicit NULL is often
a good idea.  This makes the documentation a tiny bit less
wieldy if you have lots of parameters ...



[Rd] =?utf-8?q?On_the_mechanics_of_function_evaluation_and_argume?= =?utf-8?q?nt=09matching?=
Ben Bolker