1 ! Copyright (C) 2013 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel sequences sets ;
8 { "seq1" sequence } { "seq2" sequence }
11 { $description "Converts the sequences to sets and takes the element-wise " { $link xor } ". Outputs elements that are in either set but not in both." }
13 "USING: sets.extras prettyprint ;"
14 "{ 1 2 3 } { 2 3 4 } setwise-xor ."
17 { $notes "Known as setxor1d in numpy." } ;
20 { $values { "set1" set } { "set2" set } { "set" set } }
21 { $description "Find the symmetric difference of two sets. Outputs a set containing elements that in either set but not in both." } ;
24 { $values { "set1" set } { "set2" set } { "?" boolean } }
25 { $description "Find whether " { $snippet "set1" } " is a proper subset of " { $snippet "set2" } ". Returns true if " { $snippet "set1" } " is a subset of " { $snippet "set2" } " but " { $snippet "set2" } " is not a subset of " { $snippet "set1" } "." } ;
27 ARTICLE: "sets.extras" "Extra sets words"
28 "The " { $vocab-link "sets.extras" } " vocabulary is a collection of words related to sets."
30 "To take the element-wise xor of two sequences as if they were sets:"
31 { $subsections setwise-xor } ;