label
Returns a structure containing the elements in a list labelled using a sequence of strings.
Syntax
-
label(L, names)-
Lis a list -
namesis a list of strings
-
-
label(L[, n1[, ...]])-
Lis a list -
n1, ... are strings
-
Description
If L is a list of objects and names a list of the same length containing strings that are valid identifiers, then label(L, names) returns a structure with this many members, the names taken from names and the values from L (in order).
label(L, n1, n2, ...) is a shorthand notation for label(L, '(n1, n2, ...)).
Examples
L ≔ '("Albus Dumbledore", 105, "headmaster")
Albus Dumbledore 105 headmaster
label(L, "name", "age", "role")
name: Albus Dumbledore age: 105 role: headmaster