Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created April 23, 2011 16:42
Show Gist options
  • Save kwilczynski/938766 to your computer and use it in GitHub Desktop.
Save kwilczynski/938766 to your computer and use it in GitHub Desktop.
Testing array indices accessor for use winitn Puppet manifest ...
krzysztof@samsung ~/Sandbox $ cat - | LOAD_PATH=. FACTERLIB=. puppet
define iterator {
notice $name
}
$array = ['a', 'b', 'c', 'd']
$result = collect_indices($array, 1, 3, 2, 10)
notice $result
iterator { $result: }
notice: Scope(Class[main]): b d c
notice: Scope(Iterator[b]): b
notice: Scope(Iterator[d]): d
notice: Scope(Iterator[c]): c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment