Skip to content

rename fields in records #5

@cvogt

Description

@cvogt

Something like

val p = person1(rename name to p1_name) & person3(rename name to p2_name)
p.p1_name
p.p2_name

However, while the .apply(rename.foo.(to).bar) builder api works, but is a bit weird and probably impossible to get ide code completion without specialized ide support. But how else to refer to non-existing fields? Maybe not allow renames, but only remove and add, like

person1(remove name) & Record(p1_name = person1.name) & person2(remove name) & Record(p2_name = person2.name)

or

(person1(remove name).p1_name = person1.name) & (person2(remove name).p2_name = person2.name)

Still brainstorming about the api.

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