----- Original Message -----
> From: "jcbollinger" <john.bollin...@stjude.org>
> To: "puppet-users" <puppet-users@googlegroups.com>
> Sent: Wednesday, November 26, 2014 1:47:41 PM
> Subject: [Puppet Users] Re: Puppet 4.0 Future Parser, Variable Case

> On Tuesday, November 25, 2014 7:38:09 PM UTC-6, Matthew Walster wrote:
>>
>> There seems to be a little ambiguity in the documentation for the future
>> parser, I was wondering if someone could clear this up for me -- I'm
>> referencing
>> https://docs.puppetlabs.com/puppet/latest/reference/experiments_future.html
>> :
>>
>> "Variable names may not contain capital letters. They are limited to
>> lowercase letters, numbers, and underscores."
>>
>> My interpretation of this in the past (future parser in 3.7) is:
>>
>> cheesecurds: YES
>> cheeseCurds: YES
>> CheeseCurds: NO
>> CHEESECURDS: NO
>>
>> However, a colleague of mine has understood this to be:
>>
>> cheesecurds: YES
>> cheeseCurds: NO
>> CheeseCurds: NO
>> CHEESECURDS: NO
>>
>> Would someone like to enlighten me as to which is correct?
>>
>>
> I don't think there's any room to interpret "may not contain capital
> letters" and "limited to lowercase letters, numbers, and underscores" as
> "may contain capital letters at some positions".  If some version of Puppet
> happens to accept 'cheeseCurds' as a variable name then that's at best an
> undocumented behavior and at worst a bug.  Inasmuch as the documentation
> indicates that such names are not allowed, it is unreasonable to expect
> Puppet to continue accepting them, or even for release notes to warn in the
> event that it stops accepting them.
> 
> Even if you think the documentation is less plain and clear than it seems
> to me, why take the risk of writing Puppet code whose validity is subject
> to uncertain interpretation?

For reference the current docs are @ 
https://docs.puppetlabs.com/puppet/latest/reference/lang_reserved.html#variables

And according to the rules in that doc, this still works in 3.7.x at least:

puppet apply -e '$fooBar="1" notice($fooBar)' --parser=future

This though fails:

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?

-- 
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/1115212011.10162.1417009957200.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to