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

RESOLVE overwrites values #1107

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

RESOLVE overwrites values #1107

Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Labels
CC.resolved Issue with CureCode status built, tested or complete Datatype: object! Test.written Type.bug

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Carl

RESOLVE is used to import external references that are undefined in a specific context. However, it overwrites all values in the target context.

In the example below, 'a has a value and should not be reset to 10 by RESOLVE. ('b has no value, so it is ok to set it to 20.)

append o1: object [a: 1] 'b
resolve o1 object [a: 10 b: 20]
?? o1

== o1: make object! [
    a: 10
    b: 20
]

Imported from: CureCode [ Version: alpha 70 Type: Bug Platform: All Category: Native Reproduce: Always Fixed-in:alpha 71 ]
Imported from: metaeducation#1107

Comments:

Rebolbot commented on Jul 14, 2009:

Submitted by: BrianH

If that is the definition of RESOLVE, this is big news. Code has already been written with the old definition in mind. We will have to go over all code that uses RESOLVE to see if the overwriting was intentional on a case-by-case basis.

We might need an /all option to force the overwriting behavior. Created ticket #1108 for this.


Rebolbot commented on Jul 14, 2009:

Submitted by: BrianH

While you are rewriting RESOLVE, don't forget #1095.


Rebolbot commented on Jul 14, 2009:

Submitted by: Carl

This bug was discovered during the process of separating the system and user contexts.

When separated, definitions for all system (exported) values must be imported (resolved) into the user context. This has now been added to LOAD (although we can debate the best place to put it.) However, my tests failed immediately! It was due to RESOLVE wiping the user context on the evaluation of the second test file.

It was a one line change to fix RESOLVE. All tests pass.


Rebolbot commented on Jul 14, 2009:

Submitted by: BrianH

This change will likely prevent the proposed change to MAKE object! to make it work like OBJECT (probably a good thing).


Rebolbot added the Type.bug on Jan 12, 2016


@Siskin-Bot Siskin-Bot added the CC.resolved Issue with CureCode status built, tested or complete label May 22, 2020
@Oldes Oldes closed this as completed Sep 23, 2021
Oldes added a commit to Oldes/Rebol3 that referenced this issue Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CC.resolved Issue with CureCode status built, tested or complete Datatype: object! Test.written Type.bug
Projects
None yet
Development

No branches or pull requests

2 participants