Skip to content

New C API wrenCopySlot() #836

@ChayimFriedman2

Description

@ChayimFriedman2

In short, we need a C function to copy one slot to another, not matter what it contains. The implementation in C is straightforward.

Why?

Because setters, that's why.

Setters should return their argument in order to keep Wren assignment semantics. See wren-lang/wren-cli#54 for a broader explanation.

Edit: To clarify, setters should return the assigned value, i.e. the value after transformations was applied. This does not matter most of the cases though.

Setters not always know their arguments. For foreign setters to be correctly implemented, we need now to switch the wrenGetSlotType() and use the appropriate method. Ugh. A wrenCopySlot() will be much better.

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