On 26 November 2014 at 21:52, R.I.Pienaar <r...@devco.net> wrote: > puppet apply -e '$FooBar="1" notice($FooBar)' --parser=future > Error: Illegal variable name, The given name 'FooBar' does not conform to > the naming rule /^((::)?[a-z]w*)*((::)?[a-z_]w*)$/ at line 1:1 > > Which is weird because 'fooBar' also doesnt match this rule so why did it > work? >
So, the specification at https://github.com/puppetlabs/puppet-specifications/blob/master/language/types_values_variables.md states: NamedVariable : /[a-z_]\w*/ | /(::)?[a-z]\w*(::[a-z]\w*)*/ That implies to me that fooBar would work, because the first character is part of [a-z_], and all successive characters have to be a word character (i.e. upper or lower case). I had a quick chat with Henrik Lindberg in IRC, turns out that the future parser in 3.7 should behave as in 4.0 -- so if fooBar works now, it will work in future. He specifically told me "CamelCase is ok as long as the camel starts with a c and not a C" and that "internall[y], all names of classes etc is turned into lower case anyway" So, Java fans, looks like camelCase lives on. snake_case seems to be the preferred option for puppet, but it's not strictly enforced. Hope that clears things up. As I understand it, the documentation at https://docs.puppetlabs.com/puppet/latest/reference/experiments_future.html will be updated. M -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CADLW2vyo1Lw20V1Tqa%3DsL%2B4TGXd6WxFFSSVb3zyj-kuwvcOSuw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.