Skip to content

Forcing dot-exports and/or renaming exports #19

@mmuurr

Description

@mmuurr

While the dot-prefix has obvious advantages for implied convention behavior, it'd be useful at times to be able to force exports of an object that has a dot prefix, e.g. in a file module.R:

.f <- function() NULL
modules::export(.f)

Then at the R prompt:

> foo <- modules::use("module.R")

 Error in exportExtract2List(module) : exports not defined: .f

(I realize we could add an additional line in the module file (f <- .f) to overcome this, but I'm wondering if we can explicitly specify what should/shouldn't be exported regardless of the naming convention.)

Similarly, it doesn't appear that we can rename objects when explicitly exporting them, e.g., this might be nice in module.R:

.f <- function() NULL
modules::export(f = .f)

Then at the R prompt:

> foo <- modules::use("module.R")
> foo$f()

NULL

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions