Issue #21252 has been updated by Henrik Lindberg.

The documentation is wrong.

<pre>
[1,20,3].select |$value| {$value < 10 }.each |$value| { notice $value }

# produces the output
Notice: Scope(Class[main]): 1
Notice: Scope(Class[main]): 3
</pre>

The output I get:
<pre>
uppet apply --parser future --trace -e '[1,20,3].select |$v| { $v < 10 }.each 
|$v| { notice($v) }'
Notice: Scope(Class[main]): 1
Notice: Scope(Class[main]): 3
</pre>

The function `collect` returns an array with each result. 

There is however something else going on. The expected result from the code in 
the documentation should have been:
<pre>
Notice: Scope(Class[main]): true
Notice: Scope(Class[main]): false
Notice: Scope(Class[main]): true
</pre>

I am currently investigating the cause of that.

----------------------------------------
Bug #21252: Parser future Chaining Functions don't work.
https://projects.puppetlabs.com/issues/21252#change-92976

* Author: Vadim Lebedev
* Status: Accepted
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: parser
* Target version: 
* Affected Puppet version: 3.2.1
* Keywords: function_chaining
* Branch: 
----------------------------------------
This is example from official documentation:

<pre>
[1,20,3].collect |$value| {$value < 10 }.each |$value| { notice $value }

# produces the output
Notice: Scope(Class[main]): 1
Notice: Scope(Class[main]): 3
</pre>

On my pueppet:

<pre>
puppet apply --parser future -e '[1,20,3].collect |$value| {$value < 10 }.each 
|$value| { notice $value }'
Notice: Scope(Class[main]): true
Error: Too few arguments; 1 for 1 at :1 on node xxx
Error: Too few arguments; 1 for 1 at :1 on node xxx

Ubuntu 12.04
Puppet install from puppetlabs repo. 

dpkg -l
puppetmaster 3.2.1-1puppetlabs1 
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to