Issue #21252 has been updated by Henrik Lindberg. Subject changed from Parser future Chaining Functions don't work. to lambda produces nil for false, and does not accept nil as argument Keywords changed from function_chaining to parser lambda false return
Found the problem; a lambda could not return a Boolean false, it got translated to nil, and thus when using `collect`, the result was `[true, nil, true]`, and `nil` was later not recognized as an argument with a value. Changing the title of this issue to reflect the problem. Doc patch is here: https://github.com/puppetlabs/puppet-docs/pull/180 Code patch coming. ---------------------------------------- Bug #21252: lambda produces nil for false, and does not accept nil as argument https://projects.puppetlabs.com/issues/21252#change-92984 * Author: Vadim Lebedev * Status: Accepted * Priority: Normal * Assignee: Henrik Lindberg * Category: parser * Target version: * Affected Puppet version: 3.2.1 * Keywords: parser lambda false return * 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.
