On 2014-02-11 10:19, Joshua Hoblitt wrote:
On 11/01/2014 03:35 AM, David Schmitt wrote:
On 2014-11-01 01:22, Henrik Lindberg wrote:

The requirement to compare strings and numerals can also be
implemented by converting the numeral to a string (using a canoical
non-locale dependent format). This produces a much safer route, as
creating a string has less degrees of freedom.
I believe this is the perl5 approach, which seems to be robust.

One has to remember that Number to String also has a number of options - which radix/base to use, the number of significant digits, scientific notation for floating point etc.


* Add === operator to compare both type and value. This is a slippery
slope since we probably want Integer and Float to compare equal - say
0.0 and 0. It adds yet another operator, and we have to decide what
case, selector and in should use since there is no way to specify if one
or the other should be used.
Oh hell no!

# best effort, or fail
convert_to(Number, value)
It would require changes to the lexer but another syntactic option (not
that I'm advocating it) would be C style type coercion.

(String)$my_hungarian_integer

That is sort of what I am proposing - that there be one way to convert by invoking an operation on a type.

-Josh

--



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/m36ii7%24ua8%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to