Re: Array of slist

2010-06-11 Thread Daniel Dehennin
Seva Gluschenko writes: > It is known that the iteration depth of variables is limited in > Cfengine. As of 3.0.4p2 the following test.cf [...] > produced the following output: > > R: outer: This > R: outer: is > R: outer: an > R: outer: array > R: outer: element > R: outer: too > R: inner: th

Re: Array of slist

2010-06-07 Thread Seva Gluschenko
It is known that the iteration depth of variables is limited in Cfengine. As of 3.0.4p2 the following test.cf body common control { bundlesequence => { "outer", "inner" }; } bundle agent outer { vars: "arr[idx1]" string => "this is an array element"; "arr[idx2]" slist => { "This", "

Array of slist

2010-06-07 Thread Daniel Dehennin
Hello, In the reference manual I found that array can be of type scalar or list, but I did not manage to use list iteration: --8<---cut here---start->8--- body common control { bundlesequence => { "test" }; version => "0.0.2"; } bundle agent test { va

Re: Indexing an array of slist?

2010-03-05 Thread daniel . klein
The quick answer is "you don't". The longer answer is: an slist (or ilist or rlist) can only be iterated over in it's entirety by referencing the list as a scalar (and then cfengine iterates over the whole list automagically). You can index an array (which is what 'foo' is in your example), but a

Indexing an array of slist?

2010-03-04 Thread Steve Barnes
Hi Apologies if I'm a bit late to the party on this subject, but how do you reference a specific sub-element of an slist that is a value part of an associative array? So far all the doco I've read is a bit light on more "advanced" uses of arrays. For example, I have the following var defined: