The three consecutive full-stops ...
is known as a spread operator, and it is mentioned in the Array data documentation.
The operator basically converts the Array of items into a sequence of arguments to be passed to the macro.
eg. if you had an Array like the following…
(set: $fruits to (a: "Apple", "Banana", "Cherry", "Date"))
…then using the spread operator like so…
(for: each _item, ...$fruits)[ _item ]
…is the functional equivalent of…
(for: each _item, "Apple", "Banana", "Cherry", "Date")[ _item ]
re: Why (if: $test contains "lactose")
doesn’t work as you expected.
The Array variation of the contains comparison operator compares the entire contents of each Array element against the right side value using an exactly equals to equality test.
eg. that (if:)
macro call is functionally the equivalent of…
(set: $found to false)
(for: each _item, ...$test)[
(if: _item is "lactose")[
(set: $found to true)
]
]
…and none of the String elements in your array are exactly equal to “lactose”.
What you functional want would be the equivalent of…
(set: $found to false)
(for: each _item, ...$test)[
(if: _item contains "lactose")[
(set: $found to true)
]
]
…which is using the String variation of the contains operator to determine if any of the String elements in array contains the word “lactose”.
note: The slightly more advanced (some-pass: )
macro could be use to achieve the outcome you were trying to achieve…
(if: (some-pass: _item where _item contains "lactose", ...$test))[Yay!]
(else:)[Nope]
…but that would required learning about Harlowe’s Lambda data type. The above is basically doing the same looping through the Array’s elements as the previous (for:)
macro example, and applying a similar String related contains comparison against each String element.