Skip to content

Allow for recursive merge of NamedTuples #29215

@stakaz

Description

@stakaz

Hello, it would be great, when something like this:

Base.merge(front::NamedTuple, tail::NamedTuple...) = merge(merge(front, tail[1]), tail[2:end]...)

would be available in Base.

It is a very common thing to merge multiple tuples together and would be really a sweet sugar. like this:

julia> A = (a = 1, b = 1);
julia> B = (a = 2, c = 2);
julia> C = (b = 3, d = 2);
julia> merge(A,B,C)
(a = 2, b = 3, c = 2, d = 2)

Are there any reasons this is not in Base?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions