Skip to content

assign_in and modify_in should create nested elements #704

@vspinu

Description

@vspinu

Current implementation of assign_in, update_in and pluck<- doesn't create new elements.
This is in contrast to [[<- semantics and most importantly to the parallel functional tooling in other languages (clojure, python).

assign_in(list(), "aa", 34)
#> Error: Plucked object must have at least one element
pluck(list(), "aa") <- 34
#> Error in pluck(list(), "aa") <- 34: invalid (NULL) left side of assignment

Moreover, this is inconsistent with pluck itself which returns NULL on missing elements. So one would expect no error for missing elements in pluck<- as well.

Seems related: #636

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions