Set consolidation: Difference between revisions
→{{header|TXR}}: Argh; pasted the wrong code. Fixed now.
(→{{header|TXR}}: Translation of Racket added.) |
(→{{header|TXR}}: Argh; pasted the wrong code. Fixed now.) |
||
Line 1,450:
<lang txr>@(do
(defun mkset (
(defun
(defun
(
(
((empty-p (hash-isec s (first cs)))
(
(
[reduce-left comb ss
▲ (uni p e (car s))))
;; tests
(each ((test '(((a b) (c d))
((a b) (b d))
((a b) (c d) (d b))
((h i k) (a b) (c d) (d b) (f g h)))))
(format t "~s -> ~s\n" test
[mapcar hash-keys (consoli [mapcar mkset test])])))</lang>
Output:
|