Jira (PUP-514) Add optional type to parameters

2014-10-01 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kurt Wall




QA Status:

 Reviewed












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-07-08 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall assigned an issue to Unassigned


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kurt Wall




Assignee:

 KurtWall












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-25 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










Sorry I didn't finish this up today. PUP-2815 ate all my time.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-25 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Sprint:

 Week2014-5-21to2014-5-28,Week2014-5-28to2014-6-4,Week2014-6-4to2014-6-11,Week2014-6-11to2014-6-18,Week2014-6-18to2014-6-25 ,Week2014-6-25to2014-7-9












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-24 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










NAB because $name is a keyword in some contexts. Same with $title.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-24 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall assigned an issue to Kurt Wall


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kurt Wall




Assignee:

 KurtWall












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-24 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










Lambdas work. A single typed parameter is recognized:



$ bepa -e 'with (1)| Integer $x | { notice $x }' --parser future
Notice: 1
Notice: Compiled catalog for centos6-5-base.localdomain in environment production in 0.29 seconds
Notice: Finished catalog run in 0.03 seconds



An invalid type is rejected: $ bepa -e 'with (1)| String $x |  { notice $x }
' --parser future Error: Evaluation Error: Error while evaluating a Function Call, lambda called with mis-matched arguments expected: lambda(String x) - arg count  {1} actual: lambda(Integer) - arg count {1}
 at line 1:1 on node centos6-5-base.localdomain Error: Evaluation Error: Error while evaluating a Function Call, lambda called with mis-matched arguments expected: lambda(String x) - arg count  {1} actual: lambda(Integer) - arg count {1}
 at line 1:1 on node centos6-5-base.localdomain




Multiple parameters also work



$ bepa -e 'with(Jenny,Ive,got,your,number) | String $x, String $y, String $z |  { notice $x $y $z }
' --parser future Notice: Jenny Ive got Notice: Compiled catalog for centos6-5-base.localdomain in environment production in 0.30 seconds Notice: Finished catalog run in 0.04 seconds




As does captures-rest:



$ bepa -e 'with(Jenny,Ive,got,your,number) | String $x, String *$y |  { notice $x $y }
' --parser future Notice: Jenny [Ive, got, your, number] Notice: Compiled catalog for centos6-5-base.localdomain in environment production in 0.30 seconds Notice: Finished catalog run in 0.03 seconds

















   

 Add Comment













   

Jira (PUP-514) Add optional type to parameters

2014-06-23 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall assigned an issue to Kurt Wall


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kurt Wall




Assignee:

 KurtWall












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-23 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










Verifying in pieces at SHA=f29242346cd4304f1e372eb7e81fbc2d7e3c7612. Typed classes work:



# manifests/init.pp
class pup514 {
  define lyric(String $regrets = 'Jenny', Integer $count = 8675309) {
notice $regrets, I've had $count. What's the point of that?
  }
}

# tests/init.pp
pup514::lyric { 'nodef' : regrets = 'No regrets', count = 0 }
pup514::lyric { 'firstdef': regrets = 'Regrets', }
pup514::lyric { 'lastdef' : count = 42, }
pup514::lyric { 'bothdef' : }
pup514::lyric { 'badval': regrets = 1000, count = None, }

$ be puppet apply tests/init.pp 
Notice: No regrets, I've had 0. What's the point of that?
Notice: Regrets, I've had 8675309. What's the point of that?
Notice: Jenny, I've had 42. What's the point of that?
Notice: Jenny, I've had 8675309. What's the point of that?
Error: Expected parameter 'regrets' of 'Pup514::Lyric[badval]' to have type String, got Integer at /home/puppet/puppet/krw-pup514/tests/init.pp:19 on node ubuntu.localdomain
Error: Expected parameter 'regrets' of 'Pup514::Lyric[badval]' to have type String, got Integer at /home/puppet/puppet/krw-pup514/tests/init.pp:19 on node ubuntu.localdomain















   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...



 

Jira (PUP-514) Add optional type to parameters

2014-06-23 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










The setup:



# manifests/init.pp
class pup514 {
  define bark(String $name = 'No Name', Integer $phone = 0) {
notice Name: '$name', Number: '$phone'
  }
}  

# tests/init.pp
pup514::bark { 'obj1': name = 'Jenny', phone = 8675309, }
pup514::bark { 'obj2': name = 'Pennsylvania', phone = 65000, }
pup514::bark { 'obj3': name = 'Rhonda', }
pup514::bark { 'obj4': phone = 42, }
pup514::bark { 'obj5': }



The output from this manifest is not quite what I expected. Specifically, for obj4 and obj5, I was expecting the default values to be used where the parameters are missing.



$ be puppet apply krw-pup514/tests/init.pp
Notice: Name: 'Jenny', Number: '8675309'
Notice: Name: 'Pennsylvania', Number: '65000'
Notice: Name: 'Rhonda', Number: '0'
Error: Cannot reassign variable name on node ubuntu.localdomain
Error: Cannot reassign variable name on node ubuntu.localdomain



I expected:



Notice: Name: 'Jenny', Number: '8675309'
Notice: Name: 'Pennsylvania', Number: '65000'
Notice: Name: 'Rhonda', Number: '0'
Notice: Name: 'No Name', Number: '42'
Notice: Name: 'No Name', Number: '0'















   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







  

Jira (PUP-514) Add optional type to parameters

2014-06-23 Thread Kurt Wall (JIRA)
Title: Message Title










 

 Kurt Wall commented on an issue


















  Re: Add optional type to parameters 










Using the same setup as the previous comment with this test runner:



$ puppet apply -e pup514::bark { 'FART': name = nil, phone = 42 }
Notice: Name: 'nil', Number: '42'
Notice: Compiled catalog for ubuntu.localdomain in environment production in 0.41 seconds
Notice: Finished catalog run in 0.02 seconds



I didn't realize that nil would be coerced to String, but okay. With that in mind, I expected the next example to behave accordingly, but it doesn't. It throws a type mismatch.



$ puppet apply -e pup514::bark { 'BURP': name = nil, phone = nil }
Error: Expected parameter 'phone' of 'Pup514::Bark[FART]' to have type Integer, got String at line 1 on node ubuntu.localdomain
Error: Expected parameter 'phone' of 'Pup514::Bark[FART]' to have type Integer, got String at line 1 on node ubuntu.localdomain















   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...




 

Jira (PUP-514) Add optional type to parameters

2014-06-23 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker commented on an issue


















  Re: Add optional type to parameters 










Kurt Wall, you've run up against the special variable called $name. That variable, and $title are actually reserved. http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html#title-and-name
The error that you are getting is because the assignment of the default is causing it to try to reassign the value bound to $name, which isn't allowed.
I think there probably a bug in here about this even being allowed in some cases, which causes it to blow up like you are experiencing.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this 

Jira (PUP-514) Add optional type to parameters

2014-06-18 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5-21to2014-5-28,Week2014-5-28to2014-6-4,Week2014-6-4to2014-6-11,Week2014-6-11to2014-6-18 ,Week2014-6-18to2014-6-25












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-17 Thread Josh Cooper (JIRA)
Title: Message Title










 

 Josh Cooper commented on an issue


















  Re: Add optional type to parameters 










Henrik Lindberg can you provide more details about how to verify this ticket?












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-17 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Add optional type to parameters 










Lambdas



with(1, false, hello) | Integer $x, Boolean $y, String $z | { notice [$x, $y, $z] } # notice array of args
with(1, false, hello) | Data *$stuff | { notice $stuff } # notice array of args
with(1, 1, 1) | Boolean $x, Boolean $y, Boolean $z | { notice [$x, $y, $z] }  # error



Similar for class, define and EPP (no splat support though).



define foo(Integer $x, Boolean $y, String $z) {
 notice [$x, $y, $z]
}
foo { 'this-is-my-foo': $x = 1, $y = false, $z = hello }
# etc etc















   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA 

Jira (PUP-514) Add optional type to parameters

2014-06-16 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Add optional type to parameters 










For functional reivew:


Parameters in lambdas, defines, classes can now be typed


EPP template parameters can be typed


Untyped parameters accepts anything


Lambdas accepts varargs/captures-rest when last param has splat (e.g. *$param) (the rest of the parameters must comply with given type and are delivered in an Array.


Defines, Classes, and EPP does not accept varargs/captures-rest parameter.


TIP: The new function with accepts any arguments and passes them on to a given lambda and is good for testing lambdas (among other things).














   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, 

Jira (PUP-514) Add optional type to parameters

2014-06-13 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Add optional type to parameters 










Merged to master 069f42e












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-13 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Add optional type to parameters 










The work that was done for EPP and call by name needs to be reflected in the specification - it does not state anything about varargs/captures-rest (IIRC).












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-12 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker assigned an issue to Henrik Lindberg


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Assignee:

 HenrikLindberg












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-11 Thread Eric Sorenson (JIRA)
Title: Message Title










 

 Eric Sorenson updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Eric Sorenson




Sprint:

 Week2014-5-21to2014-5-28,Week2014-5-28to2014-6-4,Week2014-6-4to2014-6-11 ,Week2014-6-11to2014-6-18












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-04 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5-21to2014-5-28,Week2014-5-28to2014-6-4 ,Week2014-6-4to2014-6-11












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-03 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker assigned an issue to Henrik Lindberg


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Assignee:

 AndyParker HenrikLindberg












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-03 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker assigned an issue to Andy Parker


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Assignee:

 AndyParker












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-03 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Component/s:

 DOCS












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-06-03 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker commented on an issue


















  Re: Add optional type to parameters 










The type parameters are for classes, defines, and lambdas. The current implementation handles classes and defines, but the lambdas got left out in the cold. Working through that right now.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-28 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5-21to2014-5-28 ,Week2014-5-28to2014-6-4












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-27 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker assigned an issue to Andy Parker


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Assignee:

 AndyParker












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-23 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Henrik Lindberg




Sprint:

 Week2014-5- 28 21 to2014- 6 5 - 4 28












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-23 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg commented on an issue


















  Re: Add optional type to parameters 










Sorry fat-fingered a move. I restored this to Ready for Merge.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Optional[Variant[Object,Type]] i.e. anything   To optionally type a parameter simply enter the type before the parameter:  {code}  define foo(String $x, Integ...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-21 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5- 21 28 to2014- 5 6 - 28 4












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-14 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Sprint:

 Week2014-5-14to2014-5-21












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-14 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5-14to2014-5-21












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-14 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5-14to2014-5-21












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-14 Thread Kylo Ginsberg (JIRA)
Title: Message Title










 

 Kylo Ginsberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Kylo Ginsberg




Sprint:

 Week2014-5- 14 21 to2014-5- 21 28












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-14 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Henrik Lindberg









 Itisofgreatvaluetobeabletooptionallytypetheparametersofdefinesandclasses(aswellastypes).Thisisquiteeasytoimplementastherenowisatypesystem.Thedefaulttypeis Data Optional[Variant[Object,Type]]i . e.anything  Tooptionallytypeaparametersimplyenterthetypebeforetheparameter:{code}definefoo(String$x,Integer$y){code}Typecheckingtakesplaceaftergivenvaluesanddefaultshavebeenevaluated.












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-05-13 Thread Andy Parker (JIRA)
Title: Message Title










 

 Andy Parker updated an issue


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andy Parker




Fix Version/s:

 4.x




Fix Version/s:

 3.7.0












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-03-20 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters commented on an issue


















  Re: Add optional type to parameters 










I would very much like to see this added for 4.0. Andy Parker suggested the syntax would look something like this Type $var = value, which I'll +1.












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Data. 















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-514) Add optional type to parameters

2014-03-20 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Add optional type to parameters 










That syntax is what I also expect it to have (not that you have to assign to it to make it typed - in fact, in that case it could be automatically typed to the type of the given value if we want to, the user could widen the type if required)



define foo($var = 1) { ... }
foo { 'this_is_my_foo':
  var = 'batman'
}



Would fail with an error with something like: 'String batman not assignable to Integer foo::var'
Which could be widened:



define foo(Scalar $var = 1) { ... }
foo { 'this_is_my_foo':
  var = 'batman'
}



Now it works because String and Integer are both Scalar. (And you would use Object to widen to anything).
On second thought though, users can then not opt out of typing when they use defaults... ah - well... guess this type inference is off the table for that reason. 












   

 Add Comment

























 Puppet /  PUP-514



  Add optional type to parameters 







 It is of great value to be able to optionally type the parameters of defines and classes (as well as types).   This is quite easy to implement as there now is a type system.  The default type is Data. 







Jira (PUP-514) Add optional type to parameters

2014-02-14 Thread Andrew Parker (JIRA)
Title: Message Title










 

 Andrew Parker assigned an issue to Andrew Parker


















 Puppet /  PUP-514



  Add optional type to parameters 










Change By:

 Andrew Parker




Assignee:

 AndrewParker












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
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 http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.