On 11/04/2014 09:46 AM, Henrik Lindberg wrote:
> It is a bit difficult since operators are overloaded on type. The good
> part is that if we stop transforming strings to numbers there will be
> errors for arithmetic expressions.
> 
> The bad part is that ==, != cannot raise errors (since a string is
> simply not equal to a number). Currently comparisons order all numbers
> to be smaller than all strings. We could change those to instead error
> if the types are not comparable to each other.

I think raising an exception when the types of operands to a comparison
operator are different is the least surprising behavior absent automatic
type conversion.

It would also provide at lot more confidence that a manifest is 4x safe
if it passes `puppet parser validate`.  Without that you'd have to worry
about conditional expressions silently changing their result between 3x
and 4x.

-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 puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/54590CCE.1030305%40cpan.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to