Skip to content

Empty pairlist entries (argument lists) #986

@flying-sheep

Description

@flying-sheep

Getting the formals of a function results in pairlists with only named entries, but sometimes empty values:

> formals(bquote)
$expr

$where
parent.frame()
> formals(bquote)[[1L]]

> str(formals(bquote)[[1L]])
symbol 
> as.character(formals(bquote)[[1L]])
""

Looks like this is the empty symbol, but I don’t seem to be able to construct it:

> as.symbol('')
Error in as.symbol(""): attempt to use zero-length variable name
> Rcpp::evalCpp('Rcpp::Symbol("")')
Error in fun(): attempt to use zero-length variable name

How can I programmatically construct a pairlist with empty values like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions