ecl-logo Documentation

UnsortedIntersection

UnsortedIntersection[expression1, expression2, ..., expressioni]outputExpression

returns the elements that are common to expression1, expression2, ... and expressioni, in the order they are present in expression1.

Details

    Input
    Output
    General Options
    Messages
  • MismatchedHeadsHeads `1` and `2` are not the same.

Examples

Basic Examples  (5)

Handles any expression, not just lists:

Returns elements that are in the first argument and in the second:

Returns its output in the same order as the first list:

Returns the same expression if there is only one in the argument, not just lists:

Returns the same list if there is only one list:

Additional Examples  (4)

Duplicate elements are not removed by default:

Handles unlimited number of any expression, not just lists:

Handles unlimited number of arguments:

Handles unlimited number of arguments where something is in common with all of them:

Options  (6)

DeleteDuplicates  (2)

Can delete duplicate items in any expression:

Delete the duplicate items in the output:

SameTest  (4)

Can be used to compare various forms of objects:

Find the intersection of two associations by key:

Find the intersection of two associations by value:

Use an existing function to determine whether two items are the same:

Messages  (2)

MismatchedHeads  (2)

An error is shown if any of the heads with multiple input expressions do not match:

An error is shown if the heads of the two input expressions do not match:

Last modified on Thu 30 May 2024 11:48:42