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]> 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]. > 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/CAO5TtCuPj6%2BepW7O7t37kCHZL1D9H5AaK4rXjBEgaQ9%2B2dzXZg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
