List Values

list =
  [{expression [(..|to) expression [by expression]] [,]} ] |
  [ all [expression for] iterator ]

List values and Set values are very similar. The only difference is that lists are ordered collections of values that can contain duplicate elements. Please see the page on set values for a description of the use of iterators to construct list/set values.

In its simplest form:

  [ {expression[,]}]
a list is simply an ordered collection of values, optionally delimited by commas. For example:
  [1, 2, 3, 4, 5, 6, 7, 8]
  [`1' `2' `3' `4' `5' `6' `7' `8']
Contiguous ranges of values can be denoted in abbreviated form by using the double dot notation:
  [{expression .. expression[,]}]
For example:
  [1..4, 5..8]
  [`A'..`Z' `a'..`z']
(Those with fond memories of Pascal, can use `to' instead of the double dot.)

Abbreviated ranges and single values can be mixed:

  [{expression [(..|to) expression][,]}]
For example:
  [`A'..`Z' `a'..`z' `0'..`9' `_']
Ranges with an increment other than 1 can be specified using the by option:
  [{expression [(..|to) expression [by expression]] [,]} ]
For example:
  [1 .. 10 by 2] = [1 3 5 7 9]
  [9..1 by -1] = [9 8 7 6 5 4 3 2 1]
Note that inverse ranges must be specified using the by option. For example:
  [1..1] = [1]
  [1..2] = [1 2]
  [2..1] = []

Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.