Hashes, sequences and collections

Some variables do not contain any displayable content themselves, but rather, are containers; they contain other variables. There are two basic types of container: hashes and sequences.

One very basic difference between hashes and sequences is that the latter defines an ordering (or sequence) for the items it contains (i.e. which subvariable is the first, the second, the third, etc.) while the former has no intrinsic ordering.

Note that it is possible for a variable to be both a hash and a sequence, in which case, it would support index-based access as well as access by lookup name. However, typically a container will be either a hash or a sequence, not both.

A variable that is a collection is used like a sequence except that you cannot access its size or retrieve its subvariables by index. From your viewpoint a collection is just a restricted sequence that can only be used with list directive.


Page generated: 2006-03-15 13:49:01 GMT FreeMarker Manual -- For FreeMarker 2.3.6