&reply.NAS-IP-Address[2]
----
+=== Array References in lists
+
+It is sometimes useful to refer to children of a list, without
+addressing the children by name. In that case, the name of the child
+attribute can be omitted, as follow:
+
+.Examples
+[source,unlang]
+----
+&request.[0]
+----
+
+i.e. "the first child of the `request` list.
+
+This syntax is most useful in xref:xlat/attribute.adoc[xlat attribute references].
+
+Note that the old syntax of `&request[...]` is disallowed.
+
== Parent / child references
.Syntax
Adding the leading `&` character means that attribute references are
now easily distinguishable from literal strings.
-// Copyright (C) 2021 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
+// Copyright (C) 2022 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.
== Additional Variations
`%{Attribute-Name[#]}`::
+
Returns an integer containing the number of named attributes
`%{Attribute-Name[0]}`::
Returns a comma-separated string containing all values for the named
attributes.
-// Copyright (C) 2021 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
+== Lists and Grouping attributes
+
+There is similar syntax for referencing children of a list, without
+addressing the children by name.
+
+`%{request.[#]}`::
+Returns an integer containing the number of attributes contained in the `request` list. Any list name can be used.
+
+
+`%{request.[0]}`::
+
+Returns the value of the first attribute in the `request` list.
+
+`%{request.[*]}`::
+
+Returns a comma-separated string containing all values of attributes in the `request` list.
+
+See also xref:unlang/attr.adoc[unlang attribute references].
+
+Note that the old syntax of `%{request[*]}` will instead refer to
+array entries of the `request` list. This is a change from previous
+versions of the server. When upgrading, you should just add a `.`
+between the list name and the array reference `[`.
+
+// Copyright (C) 2022 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
// Development of this documentation was sponsored by Network RADIUS SAS.