Hello K.,
FYI, PlantUML can manage JSON array, and you can use:
!$data={
"colors": ["red", "yellow", "blue", "green", "white"],
"shapes": ["circle", "rectangle", "square", "triangle"]
}
And access to data:
'with JSON (zero-based array), you can have: $data.colors[$arg] and $data.shapes[$i]...
Then, here is the full example:
@startuml
!$data={
"colors": ["red", "yellow", "blue", "green", "white"],
"shapes": ["circle", "rectangle", "square", "triangle"]
}
title Array support example
!procedure $foo($arg)
:procedure start;
!while $arg!=0
!$i=2
#palegreen:arg=$arg;
!while $i!=0
'it would be nice here to be able able
'indexing the arrays like so $colors[$arg], $shapes[$i]
'with json (zero-based array), you can have: $data.colors[$arg] and $data.shapes[$i]...
#$data.colors[$arg]:arg=$arg and i=$i / $data.colors[$arg] - $data.shapes[$i];
!$i = $i - 1
!endwhile
!$arg = $arg - 1
!endwhile
:procedure end;
!endprocedure
start
$foo(2)
end
@enduml

See also:
If that can help,
Enjoy,
Regards,
Th.