From 0757a921ab7db0f15ea703b5f5b185fa5a035ba6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 13 Feb 2019 00:51:53 -0800 Subject: hash-symdiff: new function. * hash.c (hash_symdiff): New function. (hash_init): hash-symdiff intrinsic registered. * hash.h (hash_symdiff): Declared. * txr.1: Documented. --- txr.1 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index f4242042..7118b588 100644 --- a/txr.1 +++ b/txr.1 @@ -41549,10 +41549,11 @@ dohash early using or .codn (return) . -.coNP Functions @, hash-uni @ hash-diff and @ hash-isec +.coNP Functions @, hash-uni @, hash-diff @ hash-symdiff and @ hash-isec .synb .mets (hash-uni < hash1 < hash2 <> [ join-func ]) .mets (hash-diff < hash1 << hash2 ) +.mets (hash-symdiff < hash1 << hash2 ) .mets (hash-isec < hash1 < hash2 <> [ join-func ]) .syne .desc @@ -41615,6 +41616,25 @@ in .code hash2 are deleted. +The +.code hash-symdiff +function performs a symmetric difference. A new hash is returned which +contains all of the keys from +.meta hash1 +that are not in +.meta hash2 +and +.IR "vice versa" : +all of the keys from +.meta hash2 +that are not in +.metn hash1 . +The keys carry their corresponding values from +.meta hash1 +and +.metn hash2 , +respectively. + The .code hash-isec function performs a set intersection. The resulting hash contains -- cgit v1.2.3