Agreed. This is a tool that 'ops' people should also be able to use and not 
require a black belt in C type casting or an understanding of the parser to 
figure out when a string is actually a string and will be treated as such.

On Monday, 3 November 2014 22:06:03 UTC+1, Thomas Hallgren wrote:
>
> I know that primitives are converted by casts in may languages but most of 
> them (if any) would not classify string as a primitive. I think we should 
> refrain from this kind of "magic" since it's less clear what it will do. 
> Anyone familiar with C++, C# or Java will probably perceive a string cast 
> the same way I do.
>
> On Mon, Nov 3, 2014 at 9:42 PM, Joshua Hoblitt <[email protected] 
> <javascript:>> wrote:
>
>> On 11/03/2014 02:09 AM, Thomas Hallgren wrote:
>> >>
>> >> (String)$my_hungarian_integer
>> > I perceive this as a type cast, not a conversion, and would expect a
>> > runtime exception unless $my_hungarian_integer already is a string.
>>
>> Welcome to the "magic" of C.  The type casting syntax is both a way of
>> explicitly declaring a conversion (primitives only) and a means to
>> bypass type safety.  The behavior is dependent on the type.
>>
>> https://en.wikipedia.org/wiki/Type_conversion_in_C
>>
>> I was calling it out in conversion context.
>>
>> -Josh
>>
>> --
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-dev/5457E8BD.30205%40cpan.org.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/7b05fe6d-f8f9-4838-8664-486e4fe21c00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to