Skip to content

Ordered set insert requires duplicate checks #641

Open

Description

@TomokiMiyauci

What is the issue with the Infra Standard?

In the current specification, "add" is not defined.

infra/infra.bs

Lines 1492 to 1493 in 0805cea

<p>To <dfn export for=list,set>insert</dfn> an <a for=list>item</a> into a <a>list</a> before an
index is to add the given item to the list between the given index &minus; 1 and the given index. If

Therefore, insert in ordered set is missing the “do nothing in case of duplicate item” statement.

There should be a definition for ordered set like append or prepend.

Activity

  1. domenic commented on Aug 18, 2024

    @domenic
    Member

    Can you give an example of a spec that needs insert, and for which append/prepend does not suffice?

  2. TomokiMiyauci commented on Aug 18, 2024

    @TomokiMiyauci
    Author

    My understanding is that insert is already defined for set as well as list.

    <dfn export for=list,set>insert</dfn>

    Is this incorrect?

  3. domenic commented on Aug 19, 2024

    @domenic
    Member

    Yes, I'm just wondering if we should delete that and rely on people using append/prepend instead.

  4. TomokiMiyauci commented on Aug 19, 2024

    @TomokiMiyauci
    Author

    It seems necessary to investigate how much the ordered set insert is being referenced.

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

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