10.5.1 Looping Over Structure Elements

A special form of the for statement allows you to loop over all
the elements of a structure:

for [ val, key ] = expressionbody
endfor

In this form of the for statement, the value of expression
must be a structure. If it is, key and val are set to the
name of the element and the corresponding value in turn, until there are
no more elements. For example: