* Luke Kanies <l...@madstop.com> [090912 20:21]: > >>> Currently you may have a class, and u know this class require these > >>> attributes/variables as below and you would want to validate, you > >>> could do: > >>> > >>> class foo { > >>> if !$attr { fail('Please specify an $attr variable') } > >>> > >>> // do stuff > >>> } > >>> > >>> Luke is proposing that the compiler will validate existing of the > >>> right required attributes and throw these errors for you. > >> [..] > > > > This obviously implies new syntax? If so, this syntax should be > > available asap, if you don't want to keep all the compat stuff > > around in 1.0. > > What compat stuff needs to be worried about? We're only adding, not > removing.
Maybe I understood it wrong, but I thought things like this would stop working: # don't set $attr class foo { if $attr { # everything is fine } else { $attr = "default" } } Now, if you intend to only throw deprecation warnings in this case for 1.0 this sounds like compat stuff(?) > > And, conditional defaults will still require some trickery. > > Otherwise this sounds like a good thing. > > We don't support conditional defaults right now, do we? I think we're > actually a bit strict in our defaults currently, not we necessarily > should be, but we are. I might actually try to fix the binding > problems of default values, when specified as variables, on a related > note. I guess one just has to adapt the dirty tricks to the new syntax. If I'm not making any sense feel free to ignore me on language topics though :-) -- christian hofstaedtler --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---