Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Garrett Guillotte commented on PUP-7904 Re: return() errors inside iteration functions Henrik Lindberg I'm sorry, I'm not sure that I'm parsing this sentence accurately. If called from within a lambda the return will return from the function containing the lambda (as opposed to from the function being given the lambda). Specifically, I don't understand "the return will return from the function", and I'm not confident that I understand the distinction between "the function containing the lambda" and "the function being given the lambda". Is this interpretation accurate? If the return function is called from within a lambda, the return action is from the scope of the function containing the lambda (top scope), not the function accepting the lambda (local scope). With the additional example of: **Example:** Using `return` in a lambda # Concatenate three strings into a single string formatted as a list. function getFruit() { with("apples", "oranges", "bananas") |$x, $y, $z| { return("${x}, ${y}, and ${z}") }
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Garrett Guillotte assigned an issue to Henrik Lindberg Puppet / PUP-7904 return() errors inside iteration functions Change By: Garrett Guillotte Assignee: Garrett Guillotte Henrik Lindberg Add Comment This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Josh Cooper assigned an issue to Garrett Guillotte Puppet / PUP-7904 return() errors inside iteration functions Change By: Josh Cooper Assignee: Garrett Guillotte Add Comment This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Josh Cooper commented on PUP-7904 Re: return() errors inside iteration functions ping Garrett Guillotte Add Comment This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Josh Cooper updated an issue Puppet / PUP-7904 return() errors inside iteration functions Change By: Josh Cooper Team: Platform Core Add Comment This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Josh Cooper updated an issue Puppet / PUP-7904 return() errors inside iteration functions Change By: Josh Cooper Component/s: DOCS Add Comment This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Henrik Lindberg commented on PUP-7904 Re: return() errors inside iteration functions Jo Rhett The thing here is that the return ends up returning from the "top scope". If instead wrapped in a function (like below), then you get a return from the function lexically containing the lambda: function test() { with(1) |$num| { return() } notice "not reached" } test() Add Comment
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7904 return() errors inside iteration functions Change By: Henrik Lindberg Priority: Major Normal Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Henrik Lindberg commented on PUP-7904 Re: return() errors inside iteration functions The documentation is wrong - the return is (and should be) from the lambda's closure as shown by the spec test. Changing this to a docs ticket. I think the docs should be changed to: If called from within a lambda the return will return from the function containing the lambda (as opposed to from the function being given the lambda) Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7904 return() errors inside iteration functions Change By: Henrik Lindberg Fix Version/s: PUP 4.10.z Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-7904) return() errors inside iteration functions
Title: Message Title Jo Rhett created an issue Puppet / PUP-7904 return() errors inside iteration functions Issue Type: Bug Affects Versions: PUP 4.10.6 Assignee: Unassigned Created: 2017/09/04 1:06 PM Priority: Major Reporter: Jo Rhett So the documentation for return() says plainly that it will return from a lambda, ending evaluation of the function. https://docs.puppet.com/puppet/4.10/function.html#return: If called from within a lambda the return will return from the function evaluating the lambda. So let's build a short manifest and use a function that evaluates a lambda: with(1) |$num| { return()