Closed krlmlr closed 7 years ago
I agree that dealing with trailing commas can be a bit annoying, but I'm not convinced that it justifies adding support for a new syntax, which would be kind of magical for those who haven't seen it before.
You could also write your own function like this:
listify <- function(expr) {
expr <- substitute(expr)
env <- new.env(parent = parent.frame())
eval(expr, envir = env)
as.list.environment(env)
}
listify({
initialize = function(...) NULL
run = function(...) NULL
})
# $initialize
# function (...)
# NULL
# <environment: 0x6e28610>
#
# $run
# function (...)
# NULL
# <environment: 0x6e28610>
Would you consider also supporting the following notation:
The formula objects created here need some massaging: