|
 |
 |
 |
 |
 |
 |
 |
 |
 |
l |
The first element
of a list can be separated from the tail
|
|
using operator |
|
|
|
Example:
|
|
|
Match the list
[tom,dick,harry,fred] to
|
|
|
[X|Y] then
X = tom and Y = [dick,harry,fred]
|
|
[X,Y|Z] then
X = tom, Y = dick, and Z = [harry,fred]
|
[V,W,X,Y,Z|U] will not match
|
|
[tom,X|[harry,fred]]
gives X = dick
|
|
|
|