Skip to content

Unexpected result from getInputs(do.call(... #38

Description

@tvarju

The command CodeDepends::getInputs(quote(do.call(order, temp))) outputs (with deleted empty slots)

An object of class "ScriptNodeInfo"
Slot "inputs":
[1] "order" "temp" 

Slot "functions":
do.call 
     NA 

Slot "code":
do.call(order, temp)

I would have expected

An object of class "ScriptNodeInfo"
Slot "inputs":
[1] "temp" 

Slot "functions":
do.call order 
     NA    NA 

Slot "code":
do.call(order, temp)

Activity

  1. wlandau commented on Aug 30, 2018

    @wlandau

    A fair point, but this code analysis is all static. In do.call(order, temp), CodeDepends would need to evaluate the symbol order to know that it is a function and do.call to know that it takes a function as an argument. The same is true for getInputs(quote(vapply(1:10, sqrt, FUN.VALUE = numeric(1))))
    and getInputs(quote(purrr::map(1:10, sqrt))). It seems like CodeDepends would need to either evaluate code or look for every special case in order to notice all functions that take functions as arguments, and there are just so many.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions