Skip to content

Handlers of type builtin should not be rejected #99

@jchrom

Description

@jchrom

Hello!

Using the current CRAN version, I wanted to use as.double for integer handler, and got this strange behavior:

yml = readLines("dev/yaml/github.yaml", warn = FALSE) #GitHub's OA spec

r = yaml::yaml.load(yml, handlers = list(int = as.double))
Warning messages:
#> 1: In yaml::yaml.load(yml, handlers = list(int = as.double)) :
#>  Your handler for type 'int' is not a function; using default

But this works no problem:

r = yaml::yaml.load(yml, handlers = list(int = function(x) as.double(x)))

Handlers of type builtin should be accepted I think, though the workaround is quite painless.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions