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

Merge, flatten, length, lookup functions: more precise handling of marks #98

Merged

Commits on Apr 20, 2021

  1. function/stdlib: MergeFunc precise handling of marks

    MergeFunc will now only mark the resulting map or object with marks from
    the given maps or objects as a whole, and not aggregate individual
    element/attribute marks at the top-level result.
    
    The individual element/attribute marks will still be preserved, but
    they'll remain attached to the individual values they came from,
    avoiding the result as a whole becoming marked.
    alisdair committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    54ef8e4 View commit details
    Browse the repository at this point in the history
  2. function/stdlib: FlattenFunc precise handling of marks

    FlattenFunc will now propagate marks from lists/sets/tuples which are
    flattened to the top level result. Marks on non-flattened elements are
    retained and not assigned to the resulting collection.
    
    There is a significant change to the flattener helper function to ensure
    that marks are propagated from all nested lists/sets/tuples, even after
    first encountering an unknown collection. Previously finding an unknown
    collection allowed us to terminate early, but to preserve marks we need
    to continue to iterate through the rest of the arguments.
    alisdair committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    16a98da View commit details
    Browse the repository at this point in the history
  3. function/stdlib: LengthFunc precise handling of marks

    When taking the length of a marked collection, those marks should be
    preserved. Marks on individual elements should not propagate to the
    length result.
    alisdair committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    9322801 View commit details
    Browse the repository at this point in the history
  4. function/stdlib: LookupFunc precise handling of marks

    Several changes to Lookup to handle marks in a way that I think makes
    more sense:
    
    - If the entire collection is marked, preserve the marks on any result
      (whether successful or fallback)
    - If a returned value from the collection is marked, preserve the marks
      from only that value, combined with any overall collection marks
    - Retain marks on the fallback value when it is returned, combined with
      any overall collection marks
    - Disregard marks on the key value, as map keys and object attributes
      cannot be marked
    - Retain collection marks when returning an unknown value for a not
      wholly-known collection
    alisdair authored and apparentlymart committed Apr 20, 2021
    Configuration menu
    Copy the full SHA
    b8d7a58 View commit details
    Browse the repository at this point in the history