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

APPEND can create duplicate words in an object #1979

Open
rebolbot opened this issue Mar 1, 2013 · 4 comments
Open

APPEND can create duplicate words in an object #1979

rebolbot opened this issue Mar 1, 2013 · 4 comments

Comments

@rebolbot
Copy link
Collaborator

rebolbot commented Mar 1, 2013

Submitted by: Sunanda

ob: object []
append ob  [b: 2 b: 3 b: 4]
== make object! [
        b: 2
        b: 3
        b: 4
    ]
foreach w words-of ob [print get w]   ;; they are actually different
    2
    3
    4

This does not happen if the word is already in the object (unless it is hidden)/

ob: object []
append ob  [b: 2 b: 3 b: 4]  ;; not sure if append should error out or silently discard duplicate values
(length? words-of ob) = 1   ;; not one is bad
ob/b = 2            ;; other value is bad

CC - Data [ Version: r3 master Type: Bug Platform: All Category: Native Reproduce: Always Fixed-in:none ]

@rebolbot
Copy link
Collaborator Author

Submitted by: MarcS

Proposed fix and discussion: rebol/rebol#105

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

In the core-tests suite.

@rebolbot
Copy link
Collaborator Author

Submitted by: BrianH

Have APPEND silently override duplicate values, taking the last specified value as the one that wins. That is consistent with the behavior of APPEND when it has words that already exist in the object before the append.

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

Fixed by rebol/rebol#153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant