Issue #9849 has been updated by Henrik Lindberg.
The first suggestion looks like a request to implement named functions.
<pre>function foo(x) { return $name * 8 }</pre>
by reuse of the resource define keyword. This I like, but not by using the same
keyword as for definitions.
The second, I like, because it is cleaner that using variables.
----------------------------------------
Bug #9849: Functions in puppet, or resources that return an lvalue
https://projects.puppetlabs.com/issues/9849#change-71106
Author: Giles Constant
Status: Needs More Information
Priority: Low
Assignee:
Category: language
Target version:
Affected Puppet version:
Keywords: puppet resources functions lvalue
Branch:
Yeah, you could just use Ruby, but not all of my colleagues know ruby, but are
pretty good with puppet. It would be useful to do this:
define foo()
{
$lvalue = $name * 4
}
$value = foo { 8: }
On a side note, referencing member-values of resources would also be useful.
eg.:
foo { 'bar': message => 'hello world' }
bar { 'sdalfkjslkj': message => Foo['bar'].message }
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.