Copyright © 2001-2005 Oren Ben-Kiki, Clark Evans, Brian Ingerson
Status
This specification is a draft reflecting consensus reached by members of the yaml-core mailing list. Any questions regarding this draft should be raised on this list.
URI:
tag:yaml.org,2002:set
Shorthand:
!!set
Kind:
Mapping.
Definition:
Unordered set of non-equal values.
A set is an unordered collection of nodes such that no two nodes are equal. While sets are a fundamental mathematical type, YAML only supports them as the domains of a mapping. Hence the YAML syntax for a set is a mapping with all-null values.
Most programming languages do not have a built-in native data type
for supporting sets. Such data types are usually provided by
libraries. If no such data type is available, an application may
resort to loading a “!!set
”
into a native hash table where all values are null.
The “!!set
” tag may be given
explicitly. Alternatively, the application may choose to implicitly
type mappings with all-null values to sets. In this case, an
explicit “!!map
” transfer must
be given to mappings that have all-null values but do not represent
sets.