Contact TLCC

Notes/Domino Permutation Operators Click here to see all the Developer/Admin Tips

Date tip published:01/19/2004
Description:Built into the formula language are many @functions and operators that deal with lists. There are two types of list operators, pair-wise and permutation. This tip will explain the difference between these two list operations.


To learn more about the Notes Domino formula language and lists use the following links:

Notes Domino 6 Application Development 1
Notes Domino 6 Application Development 2



Pair-wise and Permutation Operations

Notes provides a set of pair-wise and permutation operators for lists. For the pair-wise operators, the operation is evaluated in pairs, with the first element of the first list paired in operation with the first element of the second list, and so on. With the permutation operators, each element in the first list operates with each element in the second list.

The following description of the pair-wise and permutation operators is copied here from Lotus Domino Designer 6 Help.

From Lotus Domino Designer 6 Help
Operations on lists

Operations on lists are of two types:

  • Pair-wise -- Pair­wise operators act on two lists in parallel­element fashion. The first element of list 1 pairs with the first element of list 2, the second element of list 1 pairs with the second element of list 2, and so on. If one list has fewer elements than the other, the last element in the shorter list is repeated for operations with the remaining elements of the longer list. If list 1 consists of "A":"B":"C" and list 2 consists of "1":"2," the operation is performed as though list 2 contained "1":"2":"2." For pair­wise equality tests, only one match is needed for the statement to return True, or 1.
  • Permuted -- Permutation operators act on two lists, pairing every possible combination of their values. The resulting list has an element for each pairing in the following order: list 1 element 1 paired with each element in list 2, list 1 element 2 paired with each element in list 2, and so on through the last element in list 1.

If an operation occurs on a list and a non-list value, the non-list value is paired with each element in the list.

The table below shows the pair­wise and permutation operators.
Pair-wise operatorPermutation operatorMeaning
***Multiplication
/*/Division
+*+Addition
-*-Subtraction
>*>Greater than
<*<Less than
>=*>=Greater than or equal to
<=*<=Less than or equal to
=*=Equal
!=*!=Not equal

Pair-wise Equality

A common list operation is to test if any members of one list are also members of another list. Consider this pair-wise equality expression:

"Tokyo" : "Paris" = "Toronto" : "London" : "Paris"


    On the surface, it does not appear that the above expression is TRUE, but it is when considered in a pair-wise manner. Remember that in a pair-wise operation the last element of the shorter list is repeated for operation with the remaining elements in the longer list. The graphic below demonstrates how Notes evaluates this pair-wise expression. The comparison is TRUE when one of the evaluated pairs is equal.




    Permutation Equality

    In a permutation equality expression, each element of the first list is compared to each element of the second list. Consider this permutation equality expression:

    "Tokyo" : "Toronto" *= "Toronto" : "London" : "Paris"


      Although this expression would evaluate to FALSE if it were evaluated as a pair-wise comparison, it is TRUE when evaluated as a permutation comparison. The graphic below demonstrates how Notes evaluates this permutation expression.



      Activity - Test Your Understanding

      In this activity, you will answer several multiple choice questions to test your understanding of how Notes evaluates pair-wise and permutation expressions. Expand the answer sections to check your answers.

      1. Evaluate this list expression:

        "London" : "Toronto" = "Toronto" : "London" : "Paris"

        a) True
        b) False
        Hide details for Answer to #1
        Answer to #1
          b) False

        Pair-wise comparison. The expression is true when any of the pair-wise comparisons is true.




      2. Evaluate this list expression:

        "London" : "Toronto" *= "Toronto" : "London" : "Paris"

        a) True
        b) False
        Hide details for Answer to #2
        Answer to #2
          a) True

        Permutation comparison. Each element of the first list is compared with each element of the second list.




      3. Evaluate this list expression:
        "10" : "20" : "30" + "1" : "2" : "3"

        a) "11" : "22" : "33"
        b) 11 : 22 : 33
        c) "101" : "202" : "303"
        d) 66
      Hide details for Answer to #3
      Answer to #3
          c) "101" : "202" : "303"
        Pair-wise string concatenation.




      4. Evaluate this list expression:
        10 : 20 : 30 *+ 1 : 2
        a) "11" : "22" : "33"
        b) 11 : 12 : 21: 22 : 31 : 32
        c) "101" : "202" : "303"
        d) 66
      Hide details for Answer to #4
      Answer to #4
        b) 11 : 12 : 21: 22 : 31 : 32
        Permutation addition. All values from the first list are added to all values from the second list.