# Is there a way to print the variable, in the style of "typeset -p", # but showing the -U unique-flag? %prep fpath=(../Functions/Misc) autoload load_dataset load_dataset %test newset x a b c d newset y c d e f copyset_tofrom z x print -l "$x" "$y" "$z" 0:Testing basic set creation >a b c d >c d e f >a b c d set_add_print x y set_add_in z y print $z set_add_new z x y print $z 0:Testing set addition (union) >a b c d e f >a b c d e f >a b c d e f set_subtract_new z x y print $z copyset_fromto x z set_subtract_in z y print $z set_subtract_print x y set_subtract_print y x 0:Testing set subtraction (asymmetric difference) >a b >a b >a b >e f set_intersection_new z x y print $z copyset_tofrom z x set_intersection_in z y print $z set_intersection_print x y 0:Testing set intersection >c d >c d >c d set_symmetric_difference_new z x y print $z copyset_tofrom z x set_symmetric_difference_in z y print $z set_symmetric_difference_print x y set_symmetric_difference_print y x 0:Testing set symmetric difference >a b e f >a b e f >a b e f >e f a b set_insert_list y 'a|b' '*' set_remove_list x d print -l "$x" "$y" 0:Testing basic set item addition and removal >a b c >c d e f a|b * set_intersection_print x y set_symmetric_difference_print x y set_union_print x y set_difference_print x y set_difference_print y x 0:Testing set resilience to meta characters >c >a b d e f a\|b \* >a b c d e f a\|b \* >a b >d e f a\|b \* newset z b c a set_equal x z 0:Testing set equality newset z a 'b c' set_equal x z 1:Testing set inequality