[R-pkg-devel] Export everything whose name does not start with ".".

Hugh Parsonage hugh@p@r@on@ge @end|ng |rom gm@||@com
Sat Mar 16 01:39:28 CET 2024


It would have been helpful for that person to specify their candidate
regex, rather than just saying it could be simpler.

That out of the way, I believe

   exportPattern("^[^.]")

would be sufficient since the square brackets remove any special
meaning the dot has. For an alternative, given the limitations on
syntactic identifiers in R (namely, that they must start with either a
dot or letters), one might also consider

   exportPattern("^[A-Za-z]")


On Sat, 16 Mar 2024 at 11:03, Rolf Turner <rolfturner using posteo.net> wrote:
>
>
> There was fairly recently a discussion on this list of a problem whose
> solution involved having code in NAMESPACE which exported everything
> whose name did not start with ".".
>
> In the course of this discussion it was remarked that the code given in
> "Writing R Extensions", explicitly
>
>    exportPattern("^[^\\.]")
>
> wasn't quite right and could/should have a simpler form.
>
> I don't really understand what's going on --- regular expressions
> completely blow me away.
>
> Can someone please inform me as to what the simpler form should be?
>
> [What really frustrates me is that I was *sure* I had saved the emails
> pertaining to this discussion, but now I cannot find any <expletive
> deleted> trace of what I thought I'd saved!]
>
> cheers,
>
> Rolf Turner
>
> --
> Honorary Research Fellow
> Department of Statistics
> University of Auckland
> Stats. Dep't. (secretaries) phone:
>          +64-9-373-7599 ext. 89622
> Home phone: +64-9-480-4619
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list