Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title Eric Delaney updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Eric Delaney QA Risk Assessment: Needs Assessment No Action QA Contact: Eric Delaney 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren commented on PUP-7277 Re: Add Init[T] type to type system The "1970-01-01 01:02:03 UTC" string that results in the "1970-01-01T00:00:00.0 UTC" looks like a bug. It's not related to Init[T] though, but rather to how timestamps are parsed. A notice(Timestamp('1970-01-01 01:02:03 UTC')) will output the same result. Please add a ticket for this. 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-7277) Add Init[T] type to type system
Title: Message Title Eric Delaney commented on PUP-7277 Re: Add Init[T] type to type system Henrik Lindberg [Thomas Hallgren So I was testing with this, I installed the master bits and played around with notices using different converted values. Converting Strings to Integers and Floats etc. without much of a problem. class foo { $i = 100 $io = 050 notice(Init[Integer, 16]($i)) notice(Init[Integer, 8]($io)) notice(Init[Integer, 10]($i)) notice(Init[Integer, 10]($io)) notice(Init[Float]($i)) notice(Init[Float]($io)) notice(Init[String]($i))
Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title Eric Delaney assigned an issue to Eric Delaney Puppet / PUP-7277 Add Init[T] type to type system Change By: Eric Delaney Assignee: qa Eric Delaney 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-7277) Add Init[T] type to type system
Title: Message Title Geoff Nichols updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Geoff Nichols Sprint: Agent 2017-06-28 , Agent 2017-07-12 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-7277) Add Init[T] type to type system
Title: Message Title John Duarte assigned an issue to qa Puppet / PUP-7277 Add Init[T] type to type system Change By: John Duarte Status: Ready for CI Test Assignee: qa 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system LMGTFY - https://docs.puppet.com/puppet/4.10/hiera_automatic.html (Automatic Parameter Lookup - a feature of puppet) 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-7277) Add Init[T] type to type system
Title: Message Title David Lutterkort commented on PUP-7277 Re: Add Init[T] type to type system Makes sense. Thanks for explaining ! One more question: what does APL stand for ? 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg assigned an issue to Unassigned Puppet / PUP-7277 Add Init[T] type to type system Change By: Henrik Lindberg Assignee: Henrik Lindberg 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Henrik Lindberg Story Points: 2 Release Notes Summary: The data type {{Init\[T]}} has been added to the type system. This type matches a value that is a valid argument to {{T.new}}. The addition of this type is an enabler for features such as automatic data type conversion. Sprint: Language Triage Agent 2017-06-28 Release Notes: New Feature 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
Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system Well, the type itself is only a matcher for an instance that when combined with the argument given to the type is a valid signature for the types new function. As an example this will notice true for the two matches against Init: type Artist = Object[{ attributes => { name => String, genre => String}}] $mega_death = Artist({name => 'Megadeath', genre => 'Metal'}) notice( { name => 'Bananarama', genre => 'Pop'} =~ Init[Artist] ) notice( $mega_death =~ Init[Artist] ) The arguments that can be added to Init are literal values that would typically be some kind of formats/flags - as an example the Timestamp type supports an array of time formats, and a timezone to Timestamp.new. The intent is to use the Init type in signatures to signal that a type cast/conversion is wanted. For example: class myclass(Init[Timestamp] $when) { # $when will be an instance of Timestamp }
Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title David Lutterkort commented on PUP-7277 Re: Add Init[T] type to type system Just stumbled across this and I have a question: intuitively, it seems that Init[T,args] is the type of a function args -> T. Is Init[T,args] just a more convenient notation for that or is there something more fundamental going on ? 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren assigned an issue to Henrik Lindberg Puppet / PUP-7277 Add Init[T] type to type system Change By: Thomas Hallgren Assignee: Thomas Hallgren Henrik Lindberg 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system There may be some types where the constructor has an overloaded variant that returns a transformed version of the input. So an Init[T, arg] will not match a T unless there is constructor signature of [T,arg] (i.e. cannot automatically be taken as just the given instance of T). 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Henrik Lindberg Fix Version/s: PUP 5.1.0 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system That should be changed to return the argument - that should work without any support from the type's new function implementation. Works since all instances are immutable. 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren commented on PUP-7277 Re: Add Init[T] type to type system Is it a general rule that when you call #new on a type T with a value that is an instance of T, it returns its argument? If not, I don't see how the added rule can be applied. Changing the current implementation of #new to do just that would make sense though, since it strengthens the "cast" operator semantics. Today, none of these work: $b1 = Binary('YmluYXI=') $b2 = Binary($b1) # error $t1 = Timestamp('2015-03-04T10:11:12.0001') $t2 = Timestamp($t1) #error type MyObject = Object[{}] $x = MyObject() $y = MyObject($x) # error
Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system Hm... One more rule: 3. A type is assignable to Init[T] if it assignable to T The proposed design makes it important to not design the dispatchers so that there is ever an overlap between the multiple parameters and the single parameters. For example a single parameter of Tuple[String, String], vs a dispatcher having two String parameters. That would match both 1, and 2 of your rules. I am ok with this since it is an implementation concern that only has to be considered when implementing the new function for a Type. There is a limited number of those and I don't think the set of such core types requiring this will expand. The only possible exception would be if we support overloading of user defined initializers for Object - and those are subject to interpretation by the logic in Pcore and it could make it illegal to specify overloading/dispatching such that there is this ambiguity. 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren commented on PUP-7277 Re: Add Init[T] type to type system Would it be sufficient if we established the following rules? A type is assignable to Init[T] if the type is a Tuple that is assignable to the parameter tuple of one of the dispatchers for T#new. A type is assignable to Init[T] if the type is assignable to the parameter type of one of the single parameter dispatchers for T#new. A single parameter dispatcher takes max one parameter. Additional optional parameters hence disqualifies it from rule #2. The "by name" must still be implemented as a single argument dispatcher. The alternative would be to use something other than #new such as #from_hash, from_string or similar. That's difficult though, since the #new is implicit in the parser. The more I think about it, the more I'm convinced that the dispatcher design is good enough to rely on. 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren commented on PUP-7277 Re: Add Init[T] type to type system This is not limited to a hash. It's also a general single argument problem. In many cases, a single String or an Integer can be the initializer. Consider the following: function func(String $x) { $ts = Timestamp($x) ... } versus this: function func(Init[Timestamp] $x) { $ts = Timestamp($x) ... } I would expect both to accept the same String argument. Using a "by name" hash or "by position" array just makes things less clean.
Jira (PUP-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system Also, an Init[T] could possibly also describe the signature for a resource type's 'new' (which is only call by name). 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-7277) Add Init[T] type to type system
Title: Message Title Henrik Lindberg commented on PUP-7277 Re: Add Init[T] type to type system I think it is fine to specify that Init[T] matches an Array of individual arguments that can be used to call new on T using the values as "args by position", whereas a Hash is "args by name" even if we do not have that concept for calling functions. For the time being it would mean that giving a hash is the same as giving an array wrapping that hash (single hash arg is a crutch for "call by name"). This way we do not have to change the specification for Init[T] when changing how "call by name" is implemented. 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren commented on PUP-7277 Re: Add Init[T] type to type system I share your concern and I'm not sure either, which makes it a bit hard to decide on the design and implementation of the Init[T] type. Should we table this ticket for now and engage in a more thorough design discussion regarding new, by name, by position, et. al.? 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Thomas Hallgren Summary: Add Initialization Init [T] type to type system 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-7277) Add Init[T] type to type system
Title: Message Title Thomas Hallgren updated an issue Puppet / PUP-7277 Add Init[T] type to type system Change By: Thomas Hallgren A type {{ Initialization Init \[T]}} is of great value to describe that a value/hash of values is accepted if that value can be used to initialize an instance of the parameterized type {{T}} such that a call to {{T(value)}} produces an instance of {{T}}.This is of particular value to enable modeling where a user does not have to know (or state) the actual type, and can instead simply give the input as nested hashes. 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.