Skip to content

Stdlib function for making an object selfless (replace all fields with concrete values). #835

Open
@sbarzowski

Description

@sbarzowski

Probably not so useful for real world stuff, but it would be useful for explaining the inheritance model and maybe for debugging.

Not sure what the right name for that would be. I'll use concretize for now.

It can be implemented more or less like the following:

local concretize(obj) = { [f]: obj.f for f in std.objectFields(obj) } + { [f]:: obj.f for f in std.objectFieldsAll(obj) if !std.objectHas(obj, f) }

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