Skip to content

omit_args does not work with default values #159

Description

@venpopov
library(memoise)

f <- function(n, x = 0) {
  rnorm(n)
}

fm <- memoise(f, omit_args = "x")

fm(1)
#> [1] -0.008028243
fm(1)
#> [1] -0.008028243
fm(1, x = 0)
#> [1] -0.8423555
fm(1, x = 0)
#> [1] -0.8423555
fm(1, x = 1)
#> [1] -0.8423555
fm(1)
#> [1] -0.008028243

Created on 2026-02-13 with reprex v2.1.1

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions