[Rd] Appetite for eliminating dependency on Perl

2019-08-09 Thread Ken Williams
Preamble: I am in no way opposed to Perl in general - I love Perl and
probably always will.

R currently has Perl as both a build-time and run-time dependency.  This
adds about 200 Mb, give or take, to the required environment size (as
measured in CentOS - looks like it might be a bit smaller in Ubuntu?).

Not such a huge deal, really, but the actual benefit R gets from the
dependency is quite small.  From my poking around in the R sources (using
`git grep -P '\bperl\b(?! ?= ?(?:TRUE|FALSE))' ` as a filter), it looks
like it's only used in the following nooks & crannies:

* tools/help2man.pl
* tools/install-info.pl
* configure:  INSTALL_INFO="perl \$(top_srcdir)/tools/install-info.pl"
* m4/R.m4:  INSTALL_INFO="perl \$(top_srcdir)/tools/install-info.pl"

Ultimately that's only two scripts.  `help2man.pl` seems like it's part of
the build process, but not used at runtime.  `install-info.pl` seems like
maybe it's runnable at runtime, but requires user initiation to run, at
which point the user is expected to have perl installed.  Either one of
them could probably be ported to another language pretty easily, maybe even
R.

Anything else I missed?

If someone were to volunteer the porting work, would there be any appetite
for eliminating the dependency?

  -Ken

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Appetite for eliminating dependency on Perl

2019-08-09 Thread peter dalgaard
Dunno about runtime. We used to have much more - all the Rdconv stuff used to 
be based on pattern matching by Perl scripts, but they were converted to R 
scripts and later to use proper parsers. 

For building, if you ever need to regenerate a configure script or write your 
own for a package, notice that aclocal & friends are Perl scripts. 

-pd

> On 9 Aug 2019, at 00:37 , Ken Williams  wrote:
> 
> Preamble: I am in no way opposed to Perl in general - I love Perl and
> probably always will.
> 
> R currently has Perl as both a build-time and run-time dependency.  This
> adds about 200 Mb, give or take, to the required environment size (as
> measured in CentOS - looks like it might be a bit smaller in Ubuntu?).
> 
> Not such a huge deal, really, but the actual benefit R gets from the
> dependency is quite small.  From my poking around in the R sources (using
> `git grep -P '\bperl\b(?! ?= ?(?:TRUE|FALSE))' ` as a filter), it looks
> like it's only used in the following nooks & crannies:
> 
> * tools/help2man.pl
> * tools/install-info.pl
> * configure:  INSTALL_INFO="perl \$(top_srcdir)/tools/install-info.pl"
> * m4/R.m4:  INSTALL_INFO="perl \$(top_srcdir)/tools/install-info.pl"
> 
> Ultimately that's only two scripts.  `help2man.pl` seems like it's part of
> the build process, but not used at runtime.  `install-info.pl` seems like
> maybe it's runnable at runtime, but requires user initiation to run, at
> which point the user is expected to have perl installed.  Either one of
> them could probably be ported to another language pretty easily, maybe even
> R.
> 
> Anything else I missed?
> 
> If someone were to volunteer the porting work, would there be any appetite
> for eliminating the dependency?
> 
>  -Ken
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Producing different text formats in R

2019-08-09 Thread Lluis.Hurtado
Thank you for your fast answer. It just works fine now.

And apologies for attaching heavy files.

Lluís.

> > "Lluís" ==writes:
> 
> Lluís> Dear all,
> Lluís> I am facing a strange problem with text files formats.
> 
> Lluís> I am currently using a C++ code named voro++ 
> (http://mathlbl.gov/voro++/). This code accepts text files with four columns:
> 
> Lluís>
> 
> Lluís> where id is an identification number and x,y,z are the coordinates 
> of a point in a 3D space.
> 
> Lluís> The input file, name it myfile_cpp.txt, is generated by another 
> C++ code written by myself (named quadscheme.cpp). So far, these calculations 
> involve no R code and it works just fine.
> 
> Lluís> However, now I am trying to replace my C++ code quadscheme.cpp by 
> a R function. The four columns (id,x,y,z) are produced in a matrix or Data 
> Frame and then saved in a file myfile_r.txt using write.table(). For example 
> using the following function:
> 
> Lluís> quadscheme <- function(window, ntile) {
> Lluís>   # Creates a grid of points in a 3D orthohedron. 
> Lluís>   # First point lies at the (mix,miny,miz) corner of the volume 
> and the last one at (maxx,maxy,maxz)
> Lluís>   # window: vector. Contains the minimum and maximum values of a 
> 3D orthohedron
> Lluís>   #   window <- c(minx, maxx, miny, maxy, minz, maxz)
> Lluís>   # ntile: vector. Number of points per dimension minus one. We 
> manually add a extra row of points per dimension
> Lluís>   #   ntile <- c(nstepx, nstepy, nstepz)
> Lluís>   M <- prod(ntile+1) 
> Lluís>   mat <- matrix(NA,M,4)
> Lluís>   mat[,1] <- 1:M # id column
>   
> Lluís>   # step length per dimension
> Lluís>   hi <- (window[2] - window[1])/ntile[1]
> Lluís>   hj <- (window[4] - window[3])/ntile[2]
> Lluís>   hk <- (window[6] - window[5])/ntile[3]
>   
> Lluís>   c <- 1
> Lluís>   for(i in 0:ntile[1]) {
> Lluís> x <- i*hi + window[1]
> Lluís> for(j in 0:ntile[2]) {
> Lluís>   y <- hj*j + window[3]
> Lluís>   for(k in 0:ntile[3]) {
> Lluís> z <- k*hk + window[5]
> Lluís> mat[c,2:4] <- c(x,y,z) # Add a new point to the grid
> Lluís> c <- c + 1
> Lluís>   }
> Lluís> }
> Lluís>   }
> Lluís>   write.table(mat, file="myfile_r.txt", row.names=FALSE, 
> col.names=FALSE)
> Lluís> }
> 
> Lluís> And then calling:
> 
> >> window <- c(18, 43, 171, 196, 95, 102)
> >> ntile <- c(100,100,28)
> >> quadscheme(window, ntile)
> 
> Lluís> I see no difference between both myfile_*.txt files,
> Lluís> one is created with C++ and the other one with
> Lluís> R. However, function voro++ do not accept the later one
> Lluís> (created with R and saved with write.table). I've also
> Lluís> noted that voro++ usually accepts R generated files
> Lluís> when they are small enough, but it accepts all C++
> Lluís> generated files, regardless the size.
> 
> Lluís> I know this is more a C++ than a R question, but may be
> Lluís> you can help me as well. I suspect that even if both
> Lluís> files are *.txt they have some differences that I
> Lluís> cannot see. Is there any way in R to produce different
> Lluís> kinds of txt files? Like binary instead of text files?
> Lluís> Could this be the problem?
> 
> Lluís> I attach two identical files, one produced by C++
> Lluís> (myfile_cpp.txt) and another one by the previous R
> Lluís> function (myfile_r.txt). I attach as well the C++ code
> Lluís> used to generate myfile_cpp.txt.
> 
> Lluís> Thank you in advance,
> 
> Lluís> Lluís Hurtado-Gil
> 
> In your R file, scientific notation is used:
> 
> R:
>   9 26.5 174.5 96.5
>   1e+05 26.5 174.5 96.75
>   11 26.5 174.5 97
> 
> cpp:
>   9 26.5 174.5 96.5
>   10 26.5 174.5 96.75
>   11 26.5 174.5 97
> 
> Try setting options(scipen = 20) before you write the
> file in R.
> 
> 
> 
> -- 
> Enrico Schumann
> Lucerne, Switzerland
> http://enricoschumann.net
> 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Jim Hester
To be clear, I'd be happy to contribute code to make this work, with
the changes mentioned by Duncan and elsewhere in the codebase, if
someone on R-core was interested in reviewing it.

Jim

On Thu, Aug 8, 2019 at 11:05 AM Duncan Murdoch  wrote:
>
> On 08/08/2019 10:31 a.m., Jim Hester wrote:
> > Are there technical reasons that package names cannot be snake case?
> > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > which currently returns
> >
> > "[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >
> > Is there any technical reason this couldn't be altered to accept `_`
> > as well, e.g.
> >
> >"[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >
> > I realize that historically `_` has not always been valid in variable
> > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > believe). Might we also allow underscores for package names?
>
> The tarball names separate the package name from the version number
> using an underscore.  There is code that is written to assume there is
> at most one underscore, e.g. .check_package_CRAN_incoming in
> src/library/tools/R/QC.r.
>
> That code could be changed, but so could the proposed package name...
>
> Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Kevin Wright
Please, no.  I'd also like to disallow uppercase letters in package names.
For instance, the cuteness of using a capital "R" in package names is
outweighed by the annoyance of trying to remember which packages use an
upper-case letter.

On Thu, Aug 8, 2019 at 9:32 AM Jim Hester  wrote:

> Are there technical reasons that package names cannot be snake case?
> This seems to be enforced by `.standard_regexps()$valid_package_name`
> which currently returns
>
>"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
>
> Is there any technical reason this couldn't be altered to accept `_`
> as well, e.g.
>
>   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
>
> I realize that historically `_` has not always been valid in variable
> names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> believe). Might we also allow underscores for package names?
>
> Jim
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Kevin Wright

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Gabriel Becker
Hi Jim,

While its true that it wouldn't be *particularly *hard^^ to adapt the base
code to change this, there is certainly a non-zero amount of user/package
code that relies on the well-defined package tarball naming scheme as well.
I know because I've written some myself in switchr/GRAN* but I seriously
doubt I'm the only one. I would imagine there's also quite a bit of more if
you include DEVOPSy-style build/administration scripts and not just user R
code.

To me, the benefit of this change seems a pretty minor "nice-to-have" when
weighed against breaking even a moderate amount of existing code.

^^ making sure we found every place the tarball naming scheme/package name
constraints are implicitly assumed in the R sources might well be less
trivial than we think, though once found I agree the changes would likely
be *relatively* straightforward. For example, I happen to know that in
addition to the places Duncan pointed out,  tools::update_PACKAGES relies
heavily on code that extracts the name and version of a package from
something that "looks like a package tarball" as an optimization mechanism,
so that would need to be reworked. It seems likely  (almost certain?) that
write_PACKAGES also relies on matching the tarball-name patter when
determining which packages are present, though I remember less details
there because I didn't write most of it.

Best,
~G



On Fri, Aug 9, 2019 at 9:40 AM Kevin Wright  wrote:

> Please, no.  I'd also like to disallow uppercase letters in package names.
> For instance, the cuteness of using a capital "R" in package names is
> outweighed by the annoyance of trying to remember which packages use an
> upper-case letter.
>
> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> wrote:
>
> > Are there technical reasons that package names cannot be snake case?
> > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > which currently returns
> >
> >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >
> > Is there any technical reason this couldn't be altered to accept `_`
> > as well, e.g.
> >
> >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >
> > I realize that historically `_` has not always been valid in variable
> > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > believe). Might we also allow underscores for package names?
> >
> > Jim
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
>
> --
> Kevin Wright
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread neonira Arinoem
Won't it be better to have a convention that allows lowercase, dash,
underscore and dot as only valid characters for new package names and keep
the ancient format validation scheme for older package names?

This could be implemented by a single function, taking a strictNaming_b_1
parameter which defaults to true. Easy to use, and compliance results will
vary according to the parameter value, allowing strict compliance for new
package names and lazy compliance for older ones.

Doing so allows to enforce a new package name convention while also
insuring continuity of compliance for already existing package names.

Fabien GELINEAU alias Neonira

Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :

> Please, no.  I'd also like to disallow uppercase letters in package names.
> For instance, the cuteness of using a capital "R" in package names is
> outweighed by the annoyance of trying to remember which packages use an
> upper-case letter.
>
> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> wrote:
>
> > Are there technical reasons that package names cannot be snake case?
> > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > which currently returns
> >
> >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >
> > Is there any technical reason this couldn't be altered to accept `_`
> > as well, e.g.
> >
> >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >
> > I realize that historically `_` has not always been valid in variable
> > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > believe). Might we also allow underscores for package names?
> >
> > Jim
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
>
> --
> Kevin Wright
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Ben Bolker


  Creeping code complexity ...

  I like to think that the cuteR names will have a Darwinian
disadvantage in the long run. FWIW Hadley Wickham argues (rightly, I
think) against mixed-case names:
http://r-pkgs.had.co.nz/package.html#naming. I too am guilty of picking
mixed-case package names in the past.  Extra credit if the package name
and the standard function have different cases! e.g.
glmmADMB::glmmadmb(), although (a) that wasn't my choice and (b) at
least it was never on CRAN and (c) it wasn't one of the cuteR variety.

  Bonus points for the first analysis of case conventions in existing
CRAN package names ... I'll start.

> a1 <- rownames(available.packages())
> cute <- "[a-z]*R[a-z]*"
> table(grepl(cute,a1))

FALSE  TRUE
12565  2185


On 2019-08-09 2:00 p.m., neonira Arinoem wrote:
> Won't it be better to have a convention that allows lowercase, dash,
> underscore and dot as only valid characters for new package names and keep
> the ancient format validation scheme for older package names?
> 
> This could be implemented by a single function, taking a strictNaming_b_1
> parameter which defaults to true. Easy to use, and compliance results will
> vary according to the parameter value, allowing strict compliance for new
> package names and lazy compliance for older ones.
> 
> Doing so allows to enforce a new package name convention while also
> insuring continuity of compliance for already existing package names.
> 
> Fabien GELINEAU alias Neonira
> 
> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
> 
>> Please, no.  I'd also like to disallow uppercase letters in package names.
>> For instance, the cuteness of using a capital "R" in package names is
>> outweighed by the annoyance of trying to remember which packages use an
>> upper-case letter.
>>
>> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
>> wrote:
>>
>>> Are there technical reasons that package names cannot be snake case?
>>> This seems to be enforced by `.standard_regexps()$valid_package_name`
>>> which currently returns
>>>
>>>"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
>>>
>>> Is there any technical reason this couldn't be altered to accept `_`
>>> as well, e.g.
>>>
>>>   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
>>>
>>> I realize that historically `_` has not always been valid in variable
>>> names, but this has now been acceptable for 15+ years (since R 1.9.0 I
>>> believe). Might we also allow underscores for package names?
>>>
>>> Jim
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>>
>> --
>> Kevin Wright
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Tobias Verbeke
> Creeping code complexity ...
> 
>  I like to think that the cuteR names will have a Darwinian
> disadvantage in the long run. FWIW Hadley Wickham argues (rightly, I
> think) against mixed-case names:
> http://r-pkgs.had.co.nz/package.html#naming.

Good development environments will offer content assist (or tab completion or 
similar) which will not be hindered by naming conventions (whether camel case, 
dromedary case or other forms that snaked into the R world). Talking about 
Darwinian advantages, Wikipedia[1] just taught me about the existence of 
'darwin case' ?!

Best,
Tobias

[1] https://en.wikipedia.org/wiki/Camel_case

> On 2019-08-09 2:00 p.m., neonira Arinoem wrote:
>> Won't it be better to have a convention that allows lowercase, dash,
>> underscore and dot as only valid characters for new package names and keep
>> the ancient format validation scheme for older package names?
>> 
>> This could be implemented by a single function, taking a strictNaming_b_1
>> parameter which defaults to true. Easy to use, and compliance results will
>> vary according to the parameter value, allowing strict compliance for new
>> package names and lazy compliance for older ones.
>> 
>> Doing so allows to enforce a new package name convention while also
>> insuring continuity of compliance for already existing package names.
>> 
>> Fabien GELINEAU alias Neonira
>> 
>> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
>> 
>>> Please, no.  I'd also like to disallow uppercase letters in package names.
>>> For instance, the cuteness of using a capital "R" in package names is
>>> outweighed by the annoyance of trying to remember which packages use an
>>> upper-case letter.
>>>
>>> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
>>> wrote:
>>>
 Are there technical reasons that package names cannot be snake case?
 This seems to be enforced by `.standard_regexps()$valid_package_name`
 which currently returns

"[[:alpha:]][[:alnum:].]*[[:alnum:]]"

 Is there any technical reason this couldn't be altered to accept `_`
 as well, e.g.

   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"

 I realize that historically `_` has not always been valid in variable
 names, but this has now been acceptable for 15+ years (since R 1.9.0 I
 believe). Might we also allow underscores for package names?

 Jim

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel

>>>
>>>
>>> --
>>> Kevin Wright
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>> 
>>  [[alternative HTML version deleted]]
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Gabriel Becker
On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem  wrote:

> Won't it be better to have a convention that allows lowercase, dash,
> underscore and dot as only valid characters for new package names and keep
> the ancient format validation scheme for older package names?
>

Validation isn't the only thing we need to do wrt package names. we also
need to detect them, and particularly,  in at least one case, extract them
from package tarball filenames (which we also need to be able to
detect/find).

If we were writing a new language and people wanted to allow snake case in
package names, sure, but we're talking about about changing how a small but
package names and package tarballs have always (or at least a very long
time, I didn't check) had the same form, and it seems expressive enough to
me? I mean periods are allowed if you feel a strong need for something
other than a letter.

Note that this proposal would make mypackage_2.3.1 a valid *package name*,
whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
patch. Yes its a silly example, but why allow that kind of ambiguity?



For the record @Ben Bolker 

Packages that mix case anywhere in their package name:

> table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))


FALSE  TRUE

 8818  5932


Packages which start with lower case and have at least one upper

> table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))


FALSE  TRUE

12315  2435


Packages which start with uppercase and have at least one lower

> table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))


FALSE  TRUE

11253  3497

Packages which take advantage of the above-mentioned legality of periods

> table(grepl(".", row.names(a1), fixed=TRUE))


FALSE  TRUE

14259   491

Packages with pure lower-case alphabetic names

> table(grepl("^[a-z]+$", row.names(a1)))


FALSE  TRUE

 7712  7038


Packages with pure upper-case alphabetic names

> table(grepl("^[A-Z]+$", row.names(a1)))


FALSE  TRUE

13636  1114


Package with at least one numeric digit in their name

> table(grepl("[0-9]", row.names(a1)))


FALSE  TRUE

14208   542


It would be interesting to do an actual analysis of the changes in these
trends over time, but I Really should be working, so that will have to
either wait or be done by someone else.
Best,
~G



> This could be implemented by a single function, taking a strictNaming_b_1
> parameter which defaults to true. Easy to use, and compliance results will
> vary according to the parameter value, allowing strict compliance for new
> package names and lazy compliance for older ones.
>
> Doing so allows to enforce a new package name convention while also
> insuring continuity of compliance for already existing package names.
>
> Fabien GELINEAU alias Neonira
>
> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
>
> > Please, no.  I'd also like to disallow uppercase letters in package
> names.
> > For instance, the cuteness of using a capital "R" in package names is
> > outweighed by the annoyance of trying to remember which packages use an
> > upper-case letter.
> >
> > On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> > wrote:
> >
> > > Are there technical reasons that package names cannot be snake case?
> > > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > > which currently returns
> > >
> > >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> > >
> > > Is there any technical reason this couldn't be altered to accept `_`
> > > as well, e.g.
> > >
> > >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> > >
> > > I realize that historically `_` has not always been valid in variable
> > > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > > believe). Might we also allow underscores for package names?
> > >
> > > Jim
> > >
> > > __
> > > R-devel@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > >
> >
> >
> > --
> > Kevin Wright
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread neonira Arinoem
I do not follow you Gabriel. Package name must not use digit numbers.
Tarbal will use them, taken from the DESCRIPTION file, version field.

That's why I consider the weird case name you presented as irrelevant, and
not to be considered.


Le ven. 9 août 2019 à 20:41, Gabriel Becker  a
écrit :

>
>
> On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem  wrote:
>
>> Won't it be better to have a convention that allows lowercase, dash,
>> underscore and dot as only valid characters for new package names and keep
>> the ancient format validation scheme for older package names?
>>
>
> Validation isn't the only thing we need to do wrt package names. we also
> need to detect them, and particularly,  in at least one case, extract them
> from package tarball filenames (which we also need to be able to
> detect/find).
>
> If we were writing a new language and people wanted to allow snake case in
> package names, sure, but we're talking about about changing how a small but
> package names and package tarballs have always (or at least a very long
> time, I didn't check) had the same form, and it seems expressive enough to
> me? I mean periods are allowed if you feel a strong need for something
> other than a letter.
>
> Note that this proposal would make mypackage_2.3.1 a valid *package name*,
> whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
> patch. Yes its a silly example, but why allow that kind of ambiguity?
>
>
>
> For the record @Ben Bolker 
>
> Packages that mix case anywhere in their package name:
>
> > table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
>  8818  5932
>
>
> Packages which start with lower case and have at least one upper
>
> > table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
> 12315  2435
>
>
> Packages which start with uppercase and have at least one lower
>
> > table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
> 11253  3497
>
> Packages which take advantage of the above-mentioned legality of periods
>
> > table(grepl(".", row.names(a1), fixed=TRUE))
>
>
> FALSE  TRUE
>
> 14259   491
>
> Packages with pure lower-case alphabetic names
>
> > table(grepl("^[a-z]+$", row.names(a1)))
>
>
> FALSE  TRUE
>
>  7712  7038
>
>
> Packages with pure upper-case alphabetic names
>
> > table(grepl("^[A-Z]+$", row.names(a1)))
>
>
> FALSE  TRUE
>
> 13636  1114
>
>
> Package with at least one numeric digit in their name
>
> > table(grepl("[0-9]", row.names(a1)))
>
>
> FALSE  TRUE
>
> 14208   542
>
>
> It would be interesting to do an actual analysis of the changes in these
> trends over time, but I Really should be working, so that will have to
> either wait or be done by someone else.
> Best,
> ~G
>
>
>
>> This could be implemented by a single function, taking a strictNaming_b_1
>> parameter which defaults to true. Easy to use, and compliance results will
>> vary according to the parameter value, allowing strict compliance for new
>> package names and lazy compliance for older ones.
>>
>> Doing so allows to enforce a new package name convention while also
>> insuring continuity of compliance for already existing package names.
>>
>> Fabien GELINEAU alias Neonira
>>
>> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
>>
>> > Please, no.  I'd also like to disallow uppercase letters in package
>> names.
>> > For instance, the cuteness of using a capital "R" in package names is
>> > outweighed by the annoyance of trying to remember which packages use an
>> > upper-case letter.
>> >
>> > On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
>> > wrote:
>> >
>> > > Are there technical reasons that package names cannot be snake case?
>> > > This seems to be enforced by `.standard_regexps()$valid_package_name`
>> > > which currently returns
>> > >
>> > >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
>> > >
>> > > Is there any technical reason this couldn't be altered to accept `_`
>> > > as well, e.g.
>> > >
>> > >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
>> > >
>> > > I realize that historically `_` has not always been valid in variable
>> > > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
>> > > believe). Might we also allow underscores for package names?
>> > >
>> > > Jim
>> > >
>> > > __
>> > > R-devel@r-project.org mailing list
>> > > https://stat.ethz.ch/mailman/listinfo/r-devel
>> > >
>> >
>> >
>> > --
>> > Kevin Wright
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > __
>> > R-devel@r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-devel
>> >
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/ma

Re: [Rd] Underscores in package names

2019-08-09 Thread Brian G. Peterson

On 2019-08-09 14:27, neonira Arinoem wrote:

I do not follow you Gabriel. Package name must not use digit numbers.
Tarbal will use them, taken from the DESCRIPTION file, version field.

That's why I consider the weird case name you presented as irrelevant, 
and

not to be considered.


ggplot2 ?

Numbers are allowed in package names right now.



Le ven. 9 août 2019 à 20:41, Gabriel Becker  a
écrit :




On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem  
wrote:



Won't it be better to have a convention that allows lowercase, dash,
underscore and dot as only valid characters for new package names and 
keep

the ancient format validation scheme for older package names?



Validation isn't the only thing we need to do wrt package names. we 
also
need to detect them, and particularly,  in at least one case, extract 
them

from package tarball filenames (which we also need to be able to
detect/find).

If we were writing a new language and people wanted to allow snake 
case in
package names, sure, but we're talking about about changing how a 
small but
package names and package tarballs have always (or at least a very 
long
time, I didn't check) had the same form, and it seems expressive 
enough to

me? I mean periods are allowed if you feel a strong need for something
other than a letter.

Note that this proposal would make mypackage_2.3.1 a valid *package 
name*,
whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after 
a

patch. Yes its a silly example, but why allow that kind of ambiguity?



For the record @Ben Bolker 

Packages that mix case anywhere in their package name:

> table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))


FALSE  TRUE

 8818  5932


Packages which start with lower case and have at least one upper

> table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))


FALSE  TRUE

12315  2435


Packages which start with uppercase and have at least one lower

> table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))


FALSE  TRUE

11253  3497

Packages which take advantage of the above-mentioned legality of 
periods


> table(grepl(".", row.names(a1), fixed=TRUE))


FALSE  TRUE

14259   491

Packages with pure lower-case alphabetic names

> table(grepl("^[a-z]+$", row.names(a1)))


FALSE  TRUE

 7712  7038


Packages with pure upper-case alphabetic names

> table(grepl("^[A-Z]+$", row.names(a1)))


FALSE  TRUE

13636  1114


Package with at least one numeric digit in their name

> table(grepl("[0-9]", row.names(a1)))


FALSE  TRUE

14208   542


It would be interesting to do an actual analysis of the changes in 
these

trends over time, but I Really should be working, so that will have to
either wait or be done by someone else.
Best,
~G



This could be implemented by a single function, taking a 
strictNaming_b_1
parameter which defaults to true. Easy to use, and compliance results 
will
vary according to the parameter value, allowing strict compliance for 
new

package names and lazy compliance for older ones.

Doing so allows to enforce a new package name convention while also
insuring continuity of compliance for already existing package names.

Fabien GELINEAU alias Neonira

Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit 
:


> Please, no.  I'd also like to disallow uppercase letters in package
names.
> For instance, the cuteness of using a capital "R" in package names is
> outweighed by the annoyance of trying to remember which packages use an
> upper-case letter.
>
> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> wrote:
>
> > Are there technical reasons that package names cannot be snake case?
> > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > which currently returns
> >
> >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >
> > Is there any technical reason this couldn't be altered to accept `_`
> > as well, e.g.
> >
> >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >
> > I realize that historically `_` has not always been valid in variable
> > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > believe). Might we also allow underscores for package names?
> >
> > Jim
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
>
> --
> Kevin Wright
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel





[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock

__
R-devel@r-project.org mailing list
htt

Re: [Rd] Underscores in package names

2019-08-09 Thread neonira Arinoem
Naming policies are always tricky. The one proposed by Hadley, as the one
proposed by Google, are usable but not optimal according to most common
needs, that are

1. Name a package
2. Name a class
3. Name a function
4. Name a parameter of a function
5. Name a variable


My approach is the following

1. Package names should be  made of lowercase characters, dash, dot and
underscore

2. Class names are UpperCamelCased

3. Function names are lowerCamelCased

4. Function parameters are semantic names resulting from underscore
separated lowerCamelCased function name, type acronym and length
specification.

5. Variable should be snake case


That way you can not confuse one for the other. This brings clear view,
ease reading and speeds up implementation.

As always, this could be applied to new packages and to some extends to
package upgrades

What do you think of a such approach?


Le ven. 9 août 2019 à 20:18, Ben Bolker  a écrit :

>
>   Creeping code complexity ...
>
>   I like to think that the cuteR names will have a Darwinian
> disadvantage in the long run. FWIW Hadley Wickham argues (rightly, I
> think) against mixed-case names:
> http://r-pkgs.had.co.nz/package.html#naming. I too am guilty of picking
> mixed-case package names in the past.  Extra credit if the package name
> and the standard function have different cases! e.g.
> glmmADMB::glmmadmb(), although (a) that wasn't my choice and (b) at
> least it was never on CRAN and (c) it wasn't one of the cuteR variety.
>
>   Bonus points for the first analysis of case conventions in existing
> CRAN package names ... I'll start.
>
> > a1 <- rownames(available.packages())
> > cute <- "[a-z]*R[a-z]*"
> > table(grepl(cute,a1))
>
> FALSE  TRUE
> 12565  2185
>
>
> On 2019-08-09 2:00 p.m., neonira Arinoem wrote:
> > Won't it be better to have a convention that allows lowercase, dash,
> > underscore and dot as only valid characters for new package names and
> keep
> > the ancient format validation scheme for older package names?
> >
> > This could be implemented by a single function, taking a strictNaming_b_1
> > parameter which defaults to true. Easy to use, and compliance results
> will
> > vary according to the parameter value, allowing strict compliance for new
> > package names and lazy compliance for older ones.
> >
> > Doing so allows to enforce a new package name convention while also
> > insuring continuity of compliance for already existing package names.
> >
> > Fabien GELINEAU alias Neonira
> >
> > Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
> >
> >> Please, no.  I'd also like to disallow uppercase letters in package
> names.
> >> For instance, the cuteness of using a capital "R" in package names is
> >> outweighed by the annoyance of trying to remember which packages use an
> >> upper-case letter.
> >>
> >> On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> >> wrote:
> >>
> >>> Are there technical reasons that package names cannot be snake case?
> >>> This seems to be enforced by `.standard_regexps()$valid_package_name`
> >>> which currently returns
> >>>
> >>>"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >>>
> >>> Is there any technical reason this couldn't be altered to accept `_`
> >>> as well, e.g.
> >>>
> >>>   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >>>
> >>> I realize that historically `_` has not always been valid in variable
> >>> names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> >>> believe). Might we also allow underscores for package names?
> >>>
> >>> Jim
> >>>
> >>> __
> >>> R-devel@r-project.org mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>>
> >>
> >>
> >> --
> >> Kevin Wright
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> __
> >> R-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Gabriel Becker
Neonira,

On Fri, Aug 9, 2019 at 12:27 PM neonira Arinoem  wrote:

> I do not follow you Gabriel. Package name must not use digit numbers.
> Tarbal will use them, taken from the DESCRIPTION file, version field.
>

I was referring to Jim Hester's original proposal, which AFAIU was just to
add "_" to the allowed characters. Yours goes much farther an also adds
dash but removes all numbers (which I admit I didn't notice) and upper case
letters. This is a much more radical change, and one I don't really
understand the justification for. I get forcing lowercase (Id rather the
machinery were just case insensitive, myself) but disallowing numbers,
given that one of the most popular contributed packages of all time -
ggplot2 - has a number in it, seems strange.  I also don't really grok the
desire for dashes on top of periods and underscores.


Best,

~G



> That's why I consider the weird case name you presented as irrelevant, and
> not to be considered.
>
>
> Le ven. 9 août 2019 à 20:41, Gabriel Becker  a
> écrit :
>
>>
>>
>> On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem 
>> wrote:
>>
>>> Won't it be better to have a convention that allows lowercase, dash,
>>> underscore and dot as only valid characters for new package names and
>>> keep
>>> the ancient format validation scheme for older package names?
>>>
>>
>> Validation isn't the only thing we need to do wrt package names. we also
>> need to detect them, and particularly,  in at least one case, extract them
>> from package tarball filenames (which we also need to be able to
>> detect/find).
>>
>> If we were writing a new language and people wanted to allow snake case
>> in package names, sure, but we're talking about about changing how a small
>> but package names and package tarballs have always (or at least a very long
>> time, I didn't check) had the same form, and it seems expressive enough to
>> me? I mean periods are allowed if you feel a strong need for something
>> other than a letter.
>>
>> Note that this proposal would make mypackage_2.3.1 a valid *package name*,
>> whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
>> patch. Yes its a silly example, but why allow that kind of ambiguity?
>>
>>
>>
>> For the record @Ben Bolker 
>>
>> Packages that mix case anywhere in their package name:
>>
>> > table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>>  8818  5932
>>
>>
>> Packages which start with lower case and have at least one upper
>>
>> > table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>> 12315  2435
>>
>>
>> Packages which start with uppercase and have at least one lower
>>
>> > table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>> 11253  3497
>>
>> Packages which take advantage of the above-mentioned legality of periods
>>
>> > table(grepl(".", row.names(a1), fixed=TRUE))
>>
>>
>> FALSE  TRUE
>>
>> 14259   491
>>
>> Packages with pure lower-case alphabetic names
>>
>> > table(grepl("^[a-z]+$", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>>  7712  7038
>>
>>
>> Packages with pure upper-case alphabetic names
>>
>> > table(grepl("^[A-Z]+$", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>> 13636  1114
>>
>>
>> Package with at least one numeric digit in their name
>>
>> > table(grepl("[0-9]", row.names(a1)))
>>
>>
>> FALSE  TRUE
>>
>> 14208   542
>>
>>
>> It would be interesting to do an actual analysis of the changes in these
>> trends over time, but I Really should be working, so that will have to
>> either wait or be done by someone else.
>> Best,
>> ~G
>>
>>
>>
>>> This could be implemented by a single function, taking a strictNaming_b_1
>>> parameter which defaults to true. Easy to use, and compliance results
>>> will
>>> vary according to the parameter value, allowing strict compliance for new
>>> package names and lazy compliance for older ones.
>>>
>>> Doing so allows to enforce a new package name convention while also
>>> insuring continuity of compliance for already existing package names.
>>>
>>> Fabien GELINEAU alias Neonira
>>>
>>> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
>>>
>>> > Please, no.  I'd also like to disallow uppercase letters in package
>>> names.
>>> > For instance, the cuteness of using a capital "R" in package names is
>>> > outweighed by the annoyance of trying to remember which packages use an
>>> > upper-case letter.
>>> >
>>> > On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
>>> > wrote:
>>> >
>>> > > Are there technical reasons that package names cannot be snake case?
>>> > > This seems to be enforced by `.standard_regexps()$valid_package_name`
>>> > > which currently returns
>>> > >
>>> > >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
>>> > >
>>> > > Is there any technical reason this couldn't be altered to accept `_`
>>> > > as well, e.g.
>>> > >
>>> > >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
>>> > >
>>> > > I realize that historically `_` has not always been valid in variable
>>> > > names, but this has now been a

Re: [Rd] Underscores in package names

2019-08-09 Thread neonira Arinoem
Yes Brian. That's currently possible.

I am not speaking of what is currently possible but of the rules we should
enforce, using both strict compliance for new rules and lazy compliance for
older packages

Le ven. 9 août 2019 à 21:35, Brian G. Peterson  a
écrit :

> On 2019-08-09 14:27, neonira Arinoem wrote:
> > I do not follow you Gabriel. Package name must not use digit numbers.
> > Tarbal will use them, taken from the DESCRIPTION file, version field.
> >
> > That's why I consider the weird case name you presented as irrelevant,
> > and
> > not to be considered.
>
> ggplot2 ?
>
> Numbers are allowed in package names right now.
>
>
> > Le ven. 9 août 2019 à 20:41, Gabriel Becker  a
> > écrit :
> >
> >>
> >>
> >> On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem 
> >> wrote:
> >>
> >>> Won't it be better to have a convention that allows lowercase, dash,
> >>> underscore and dot as only valid characters for new package names and
> >>> keep
> >>> the ancient format validation scheme for older package names?
> >>>
> >>
> >> Validation isn't the only thing we need to do wrt package names. we
> >> also
> >> need to detect them, and particularly,  in at least one case, extract
> >> them
> >> from package tarball filenames (which we also need to be able to
> >> detect/find).
> >>
> >> If we were writing a new language and people wanted to allow snake
> >> case in
> >> package names, sure, but we're talking about about changing how a
> >> small but
> >> package names and package tarballs have always (or at least a very
> >> long
> >> time, I didn't check) had the same form, and it seems expressive
> >> enough to
> >> me? I mean periods are allowed if you feel a strong need for something
> >> other than a letter.
> >>
> >> Note that this proposal would make mypackage_2.3.1 a valid *package
> >> name*,
> >> whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after
> >> a
> >> patch. Yes its a silly example, but why allow that kind of ambiguity?
> >>
> >>
> >>
> >> For the record @Ben Bolker 
> >>
> >> Packages that mix case anywhere in their package name:
> >>
> >> > table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >>  8818  5932
> >>
> >>
> >> Packages which start with lower case and have at least one upper
> >>
> >> > table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >> 12315  2435
> >>
> >>
> >> Packages which start with uppercase and have at least one lower
> >>
> >> > table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >> 11253  3497
> >>
> >> Packages which take advantage of the above-mentioned legality of
> >> periods
> >>
> >> > table(grepl(".", row.names(a1), fixed=TRUE))
> >>
> >>
> >> FALSE  TRUE
> >>
> >> 14259   491
> >>
> >> Packages with pure lower-case alphabetic names
> >>
> >> > table(grepl("^[a-z]+$", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >>  7712  7038
> >>
> >>
> >> Packages with pure upper-case alphabetic names
> >>
> >> > table(grepl("^[A-Z]+$", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >> 13636  1114
> >>
> >>
> >> Package with at least one numeric digit in their name
> >>
> >> > table(grepl("[0-9]", row.names(a1)))
> >>
> >>
> >> FALSE  TRUE
> >>
> >> 14208   542
> >>
> >>
> >> It would be interesting to do an actual analysis of the changes in
> >> these
> >> trends over time, but I Really should be working, so that will have to
> >> either wait or be done by someone else.
> >> Best,
> >> ~G
> >>
> >>
> >>
> >>> This could be implemented by a single function, taking a
> >>> strictNaming_b_1
> >>> parameter which defaults to true. Easy to use, and compliance results
> >>> will
> >>> vary according to the parameter value, allowing strict compliance for
> >>> new
> >>> package names and lazy compliance for older ones.
> >>>
> >>> Doing so allows to enforce a new package name convention while also
> >>> insuring continuity of compliance for already existing package names.
> >>>
> >>> Fabien GELINEAU alias Neonira
> >>>
> >>> Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit
> >>> :
> >>>
> >>> > Please, no.  I'd also like to disallow uppercase letters in package
> >>> names.
> >>> > For instance, the cuteness of using a capital "R" in package names is
> >>> > outweighed by the annoyance of trying to remember which packages use
> an
> >>> > upper-case letter.
> >>> >
> >>> > On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> >>> > wrote:
> >>> >
> >>> > > Are there technical reasons that package names cannot be snake
> case?
> >>> > > This seems to be enforced by
> `.standard_regexps()$valid_package_name`
> >>> > > which currently returns
> >>> > >
> >>> > >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> >>> > >
> >>> > > Is there any technical reason this couldn't be altered to accept
> `_`
> >>> > > as well, e.g.
> >>> > >
> >>> > >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> >>> > >
> >>> > > I realize that historically `_` has not always been valid in
> variab

Re: [Rd] Underscores in package names

2019-08-09 Thread Ben Bolker


 Ugh, but not *as* ambiguous as the proposed example (you can still
split unambiguously on "_"; yes, you could split on "last _" in
Gabriel's example, but ...)

On 2019-08-09 4:17 p.m., Duncan Murdoch wrote:
> On 09/08/2019 2:41 p.m., Gabriel Becker wrote:
>> Note that this proposal would make mypackage_2.3.1 a valid *package
>> name*,
>> whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
>> patch. Yes its a silly example, but why allow that kind of ambiguity?
>>
> CRAN already has a package named "FuzzyNumbers.Ext.2", whose tarball is
> FuzzyNumbers.Ext.2_3.2.tar.gz, so I think we've already lost that game.
> 
> Duncan Murdoch
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Duncan Murdoch

On 09/08/2019 10:23 a.m., Jim Hester wrote:

To be clear, I'd be happy to contribute code to make this work, with
the changes mentioned by Duncan and elsewhere in the codebase, if
someone on R-core was interested in reviewing it.


You seem to have ignited a lot of discussion.

Just to add my own point of view:  I think removing a restriction on the 
allowed names is a generally bad idea.  I think Rasmus Bååth gave a 
really valid complaint about the variety of naming conventions in R in a 
presentation I saw based on his article


https://journal.r-project.org/archive/2012/RJ-2012-018/index.html

Looking at the article now, it's not as entertaining as I remember his 
presentation was, but it makes good points about the value of consistency.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Duncan Murdoch

On 09/08/2019 2:41 p.m., Gabriel Becker wrote:

Note that this proposal would make mypackage_2.3.1 a valid *package name*,
whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
patch. Yes its a silly example, but why allow that kind of ambiguity?

CRAN already has a package named "FuzzyNumbers.Ext.2", whose tarball is 
FuzzyNumbers.Ext.2_3.2.tar.gz, so I think we've already lost that game.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Gabriel Becker
Duncan,


On Fri, Aug 9, 2019 at 1:17 PM Duncan Murdoch 
wrote:

> On 09/08/2019 2:41 p.m., Gabriel Becker wrote:
> > Note that this proposal would make mypackage_2.3.1 a valid *package
> name*,
> > whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
> > patch. Yes its a silly example, but why allow that kind of ambiguity?
> >
> CRAN already has a package named "FuzzyNumbers.Ext.2", whose tarball is
> FuzzyNumbers.Ext.2_3.2.tar.gz, so I think we've already lost that game.
>

I suppose technically 2 is a valid version number for a package (?) so I
suppose you have me there. But as Ben pointed out while I was writing this,
all I can really say is that in practice they read to me (as someone who
has administered R on a large cluster and written build-system software for
it) as substantially different levels of ambiguity. I do acknowledge, as
Ben does, that yes a more complex regular expression/splitting algorithm
can be written that would handle the more general package names. I just
don't personally see a motivation that justifies changing something this
fundamental (even if it is both narrow and was initially more or less
arbitrarily chosen) about R at this late date.

I guess at the end of the day, I guess what I'm saying is that breaking and
changing things is sometimes good, but if we're going to rock the boat
personally I'd want to do so going after bigger wins than this one. Thats
just my opinion though.

Best,
~G


> Duncan Murdoch
>
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread Duncan Murdoch

On 09/08/2019 4:37 p.m., Gabriel Becker wrote:

Duncan,


On Fri, Aug 9, 2019 at 1:17 PM Duncan Murdoch > wrote:


On 09/08/2019 2:41 p.m., Gabriel Becker wrote:
 > Note that this proposal would make mypackage_2.3.1 a valid
*package name*,
 > whose corresponding tarball name might be mypackage_2.3.1_2.3.2
after a
 > patch. Yes its a silly example, but why allow that kind of ambiguity?
 >
CRAN already has a package named "FuzzyNumbers.Ext.2", whose tarball is
FuzzyNumbers.Ext.2_3.2.tar.gz, so I think we've already lost that game.


I suppose technically 2 is a valid version number for a package (?) so I 
suppose you have me there. But as Ben pointed out while I was writing 
this, all I can really say is that in practice they read to me (as 
someone who has administered R on a large cluster and written 
build-system software for it) as substantially different levels of 
ambiguity. I do acknowledge, as Ben does, that yes a more complex 
regular expression/splitting algorithm can be written that would handle 
the more general package names. I just don't personally see a motivation 
that justifies changing something this fundamental (even if it is both 
narrow and was initially more or less arbitrarily chosen) about R at 
this late date.


I guess at the end of the day, I guess what I'm saying is that breaking 
and changing things is sometimes good, but if we're going to rock the 
boat personally I'd want to do so going after bigger wins than this one. 
Thats just my opinion though.


Sorry, I wasn't clear.  I agree with you.  I was just saying that the 
particular argument based on ugly tarball names isn't the reason.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Underscores in package names

2019-08-09 Thread robin hankin
Having written the 'lorentz' ,'Davies' and 'schwarzschild' packages,
I'm interested in packages that are named for a particular person.
There are (by my count) 34 packages on CRAN like this, with names that
are the surname of a particular (real) person.  Of these 34,  only 7
are capitalized.

hankin.ro...@gmail.com



hankin.ro...@gmail.com




On Sat, Aug 10, 2019 at 6:50 AM Gabriel Becker  wrote:
>
> On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem  wrote:
>
> > Won't it be better to have a convention that allows lowercase, dash,
> > underscore and dot as only valid characters for new package names and keep
> > the ancient format validation scheme for older package names?
> >
>
> Validation isn't the only thing we need to do wrt package names. we also
> need to detect them, and particularly,  in at least one case, extract them
> from package tarball filenames (which we also need to be able to
> detect/find).
>
> If we were writing a new language and people wanted to allow snake case in
> package names, sure, but we're talking about about changing how a small but
> package names and package tarballs have always (or at least a very long
> time, I didn't check) had the same form, and it seems expressive enough to
> me? I mean periods are allowed if you feel a strong need for something
> other than a letter.
>
> Note that this proposal would make mypackage_2.3.1 a valid *package name*,
> whose corresponding tarball name might be mypackage_2.3.1_2.3.2 after a
> patch. Yes its a silly example, but why allow that kind of ambiguity?
>
>
>
> For the record @Ben Bolker 
>
> Packages that mix case anywhere in their package name:
>
> > table(grepl("((^[a-z].*[A-Z])|(^[A-Z].*[a-z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
>  8818  5932
>
>
> Packages which start with lower case and have at least one upper
>
> > table(grepl("((^[a-z].*[A-Z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
> 12315  2435
>
>
> Packages which start with uppercase and have at least one lower
>
> > table(grepl("((^[A-Z].*[a-z]))", row.names(a1)))
>
>
> FALSE  TRUE
>
> 11253  3497
>
> Packages which take advantage of the above-mentioned legality of periods
>
> > table(grepl(".", row.names(a1), fixed=TRUE))
>
>
> FALSE  TRUE
>
> 14259   491
>
> Packages with pure lower-case alphabetic names
>
> > table(grepl("^[a-z]+$", row.names(a1)))
>
>
> FALSE  TRUE
>
>  7712  7038
>
>
> Packages with pure upper-case alphabetic names
>
> > table(grepl("^[A-Z]+$", row.names(a1)))
>
>
> FALSE  TRUE
>
> 13636  1114
>
>
> Package with at least one numeric digit in their name
>
> > table(grepl("[0-9]", row.names(a1)))
>
>
> FALSE  TRUE
>
> 14208   542
>
>
> It would be interesting to do an actual analysis of the changes in these
> trends over time, but I Really should be working, so that will have to
> either wait or be done by someone else.
> Best,
> ~G
>
>
>
> > This could be implemented by a single function, taking a strictNaming_b_1
> > parameter which defaults to true. Easy to use, and compliance results will
> > vary according to the parameter value, allowing strict compliance for new
> > package names and lazy compliance for older ones.
> >
> > Doing so allows to enforce a new package name convention while also
> > insuring continuity of compliance for already existing package names.
> >
> > Fabien GELINEAU alias Neonira
> >
> > Le ven. 9 août 2019 à 18:40, Kevin Wright  a écrit :
> >
> > > Please, no.  I'd also like to disallow uppercase letters in package
> > names.
> > > For instance, the cuteness of using a capital "R" in package names is
> > > outweighed by the annoyance of trying to remember which packages use an
> > > upper-case letter.
> > >
> > > On Thu, Aug 8, 2019 at 9:32 AM Jim Hester 
> > > wrote:
> > >
> > > > Are there technical reasons that package names cannot be snake case?
> > > > This seems to be enforced by `.standard_regexps()$valid_package_name`
> > > > which currently returns
> > > >
> > > >"[[:alpha:]][[:alnum:].]*[[:alnum:]]"
> > > >
> > > > Is there any technical reason this couldn't be altered to accept `_`
> > > > as well, e.g.
> > > >
> > > >   "[[:alpha:]][[:alnum:]._]*[[:alnum:]]"
> > > >
> > > > I realize that historically `_` has not always been valid in variable
> > > > names, but this has now been acceptable for 15+ years (since R 1.9.0 I
> > > > believe). Might we also allow underscores for package names?
> > > >
> > > > Jim
> > > >
> > > > __
> > > > R-devel@r-project.org mailing list
> > > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > > >
> > >
> > >
> > > --
> > > Kevin Wright
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > __
> > > R-devel@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinf