Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WISH: set OBJECT from OBJECT #2359

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Closed

WISH: set OBJECT from OBJECT #2359

Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Labels

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Oldes

It would be nice to be able set all keys in existing object from another object.
Imagine to have:

spec: object [a: b: c: none]

and data object which may looks like:

data: object [x: 3 a: 1 y: none]

and you want to make object with only fields of the spec with possible values of data object.
In Red it is possible to use set:

>> set new: copy spec data  new
== make object! [
    a: 1
    b: none
    c: none
]

In R3 it now does this nonsense:

== make object! [
    a: make object! [
        x: 3
        a: 1
        y: none
    ]
    b: make object! [
        x: 3
        a: 1
        y: none
    ]
    c: make object! [
        x: 3
        a: 1
        y: none
    ]
]

Imported from: metaeducation#2358

Comments:


Hostilefork added the Type.wish on Jan 30, 2019


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Feb 1, 2019:
FEAT: set object from object keeping only existing keys of the first one


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Feb 1, 2019:
TEST: unit test for WISH-2358: set OBJECT from OBJECT


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Feb 1, 2019:
FEAT: CHANGE: making SET native to be more compatible with Red-langua…


Oldes added a commit to Oldes/Rebol3 that referenced this issue on Feb 1, 2019:
FEAT: CHANGE: making SET native to be more compatible with Red-langua…


@Siskin-Bot Siskin-Bot added Oldes.resolved Bugs/wishes with Oldes' fixes/features Type.wish labels Feb 15, 2020
@Oldes Oldes closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants