From kr|m|r+m| @end|ng |rom m@||box@org  Fri Mar  8 22:26:17 2019
From: kr|m|r+m| @end|ng |rom m@||box@org (=?UTF-8?Q?Kirill_M=c3=bcller?=)
Date: Fri, 8 Mar 2019 22:26:17 +0100
Subject: [Rd] Ellipsis and dot-dot-number [Re: Dots are not fixed by
 make.names()]
In-Reply-To: <d5abef06-2724-ab99-16e2-0f40ad34ed3d@mailbox.org>
References: <d5abef06-2724-ab99-16e2-0f40ad34ed3d@mailbox.org>
Message-ID: <3cb0688c-2ef3-bb0e-c5db-c9c8df1c0d6e@mailbox.org>

Hi


In addition to the inconsistency in make.names(), the text in ?Reserved 
seems incomplete:

"Reserved words outside quotes are always parsed to be references to the 
objects linked to in the ?Description?, and hence they are not allowed 
as syntactic names (see make.names). They **are** allowed as 
non-syntactic names, e.g. inside backtick quotes."

`..1` and `...` are allowed for assigning, but these symbols cannot be 
used in the context of a variable. Example:

`..1` <- 1
`..13` <- 13
`...` <- "dots"
`..1`
#> Error: ..1 used in an incorrect context, no ... to look in
`..13`
#> Error: ..13 used in an incorrect context, no ... to look in
`...`
#> Error in eval(expr, envir, enclos): '...' used in an incorrect context

Does the ?Reserved help page need to mention this oddity, or link to 
more detailed documentation?


Best regards

Kirill


On 05.10.18 11:27, Kirill M?ller wrote:
> Hi
>
>
> It seems that names of the form "..#" and "..." are not fixed by 
> make.names(), even though they are reserved words. The documentation 
> reads:
>
> > [...] Names such as ".2way" are not valid, and neither are the 
> reserved words.
>
> > Reserved words in R: [...] ... and ..1, ..2 etc, which are used to 
> refer to arguments passed down from a calling function, see ?... .
>
> I have pasted a reproducible example below.
>
> I'd like to suggest to convert these to "...#" and "....", 
> respectively. Happy to contribute PR.
>
>
> Best regards
>
> Kirill
>
>
> make.names(c("..1", "..13", "..."))
> #> [1] "..1"? "..13" "..."
> `..1` <- 1
> `..13` <- 13
> `...` <- "dots"
>
> mget(c("..1", "..13", "..."))
> #> $..1
> #> [1] 1
> #>
> #> $..13
> #> [1] 13
> #>
> #> $...
> #> [1] "dots"
> `..1`
> #> Error in eval(expr, envir, enclos): the ... list does not contain 
> any elements
> `..13`
> #> Error in eval(expr, envir, enclos): the ... list does not contain 
> 13 elements
> `...`
> #> Error in eval(expr, envir, enclos): '...' used in an incorrect context
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Ellipsis and dot-dot-number [Re: Dots are not fixed by make.names()]
=?UTF-8?Q?Kirill_M=c3=bcller?=