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 @@
\code{<-} and other assignment operators is no longer allowed.
\item A warning is no longer generated when the first argument of
\code{.C}, \code{.Fortran}, \code{.Call}, or \code{.External} is
given its proper name of \code{.NAME}. Passing more than one
\code{PACKAGE}, \code{NAOK}, \code{DUP}, \code{HELPERS}, or
\code{ENCODING} argument now results in an error rather than a
warning.
given its proper name of \code{.NAME}. For the moment, the first
argument is also allowed to be called "name", though this is deprecated.
Passing more than one \code{PACKAGE}, \code{NAOK}, \code{DUP},
\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
under performance improvements.
\item [ Following changes from R Core releases described below: ]
......
......@@ -61,9 +61,10 @@
to TRUE, ENCODING to R_NilValue, PACKAGE to R_NilValue, and HELPER
to FALSE.
Also checks that the first argument is present and unnamed. Note
that since this argument is always present, removal of later
arguments won't change the head of the argument list. */
Also checks that the first argument is present and unnamed or
properly named. Note that since this argument is always present,
removal of later arguments won't change the head of the argument
list. */
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)
if (args == R_NilValue)
errorcall(call, _("'.NAME' is missing"));
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"));
r->naok = FALSE;
......@@ -513,7 +515,8 @@ static SEXP do_dotcall_e (SEXP call, SEXP op, SEXP args, SEXP env, int evald)
if (args == R_NilValue)
errorcall(call, _("'.NAME' is missing"));
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"));
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