Commit 4b399f4e authored by Radford Neal's avatar Radford Neal

allow 'name' for first arg of .C, .Call, .External (for now)

parent 14fef843
...@@ -295,10 +295,11 @@ ...@@ -295,10 +295,11 @@
\code{<-} and other assignment operators is no longer allowed. \code{<-} and other assignment operators is no longer allowed.
\item A warning is no longer generated when the first argument of \item A warning is no longer generated when the first argument of
\code{.C}, \code{.Fortran}, \code{.Call}, or \code{.External} is \code{.C}, \code{.Fortran}, \code{.Call}, or \code{.External} is
given its proper name of \code{.NAME}. Passing more than one given its proper name of \code{.NAME}. For the moment, the first
\code{PACKAGE}, \code{NAOK}, \code{DUP}, \code{HELPERS}, or argument is also allowed to be called "name", though this is deprecated.
\code{ENCODING} argument now results in an error rather than a Passing more than one \code{PACKAGE}, \code{NAOK}, \code{DUP},
warning. \code{HELPERS}, or \code{ENCODING} argument now results in an error
rather than a warning.
\item There is now a \code{helpers_no_holding} option; see note above \item There is now a \code{helpers_no_holding} option; see note above
under performance improvements. under performance improvements.
\item [ Following changes from R Core releases described below: ] \item [ Following changes from R Core releases described below: ]
......
...@@ -61,9 +61,10 @@ ...@@ -61,9 +61,10 @@
to TRUE, ENCODING to R_NilValue, PACKAGE to R_NilValue, and HELPER to TRUE, ENCODING to R_NilValue, PACKAGE to R_NilValue, and HELPER
to FALSE. to FALSE.
Also checks that the first argument is present and unnamed. Note Also checks that the first argument is present and unnamed or
that since this argument is always present, removal of later properly named. Note that since this argument is always present,
arguments won't change the head of the argument list. */ removal of later arguments won't change the head of the argument
list. */
struct special_args { int naok, dup, helper; SEXP encoding, pkg; }; struct special_args { int naok, dup, helper; SEXP encoding, pkg; };
...@@ -75,7 +76,8 @@ static int trimargs (SEXP args, int C_Fort, struct special_args *r, SEXP call) ...@@ -75,7 +76,8 @@ static int trimargs (SEXP args, int C_Fort, struct special_args *r, SEXP call)
if (args == R_NilValue) if (args == R_NilValue)
errorcall(call, _("'.NAME' is missing")); errorcall(call, _("'.NAME' is missing"));
if (TAG(args) != R_NilValue if (TAG(args) != R_NilValue
&& strcmp (CHAR(PRINTNAME(TAG(args))), ".NAME") != 0) && strcmp (CHAR(PRINTNAME(TAG(args))), ".NAME") != 0
&& strcmp (CHAR(PRINTNAME(TAG(args))), "name") != 0 /* for now */)
errorcall(call,_("the first argument should be .NAME or not be named")); errorcall(call,_("the first argument should be .NAME or not be named"));
r->naok = FALSE; r->naok = FALSE;
...@@ -513,7 +515,8 @@ static SEXP do_dotcall_e (SEXP call, SEXP op, SEXP args, SEXP env, int evald) ...@@ -513,7 +515,8 @@ static SEXP do_dotcall_e (SEXP call, SEXP op, SEXP args, SEXP env, int evald)
if (args == R_NilValue) if (args == R_NilValue)
errorcall(call, _("'.NAME' is missing")); errorcall(call, _("'.NAME' is missing"));
if (TAG(args) != R_NilValue if (TAG(args) != R_NilValue
&& strcmp (CHAR(PRINTNAME(TAG(args))), ".NAME") != 0) && strcmp (CHAR(PRINTNAME(TAG(args))), ".NAME") != 0
&& strcmp (CHAR(PRINTNAME(TAG(args))), "name") != 0 /* for now */)
errorcall(call,_("the first argument should be .NAME or not be named")); errorcall(call,_("the first argument should be .NAME or not be named"));
PROTECT (what = evald ? CAR(args) : eval(CAR(args),env)); PROTECT (what = evald ? CAR(args) : eval(CAR(args),env));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment