t3x.org / nss / union.html

(Nils' Scheme Snippets)

 
Paren matching: OFF  |  Category: math  |  Overview  |  Scheme Books  |  License
 

(union . list) => list

 
Purpose
Compute the union of a number of sets.
 
Arguments
a* sets
 
Dependencies
list-to-set
Example
(union '(v w x) '(w x y) '(x y z)) => (v w x y z)
(load "list-to-set.scm")

(define (union . a*)
  (list->set (apply append a*)))

Copyright (C) 2007 Nils M Holm <nmh @ t3x . org>