S
Shea Martin
I have the following code:
when nreturns is 0 and nparams is 1 or more I get this output:
[output]
nreturns = 1, nparams = 0, templated = true
has_returns.class = TrueClass, has_params.class = FalseClass,
templated2.class = Fixnum
has_returns = true, has_params = false, templated2 = 1
[/output]
Both 'templated2' and 'templated' should be true, not 0. I can't seem
to duplicate this in irb. Even in the debugger,
"p nreturns > 0 or nparams > 0" gives true, while "p templated" gives false.
This must be a bug in the interpreter is my guess? My ruby version is
1.8.4 win32.
Thanks,
~S
Code:
templated = nreturns > 0 or nparams > 0
puts "nreturns = #{nreturns}, nparams = #{nparams}, templated =
#{templated}"
has_returns = nreturns > 0
has_params = nparams > 0
templated2 = (nreturns or nparams)
puts "has_returns.class = #{has_returns.class}, has_params.class =
#{has_params.class}, templated2.class = #{templated2.class}"
puts "has_returns = #{has_returns}, has_params = #{has_params},
templated2 = #{templated2}"
puts ""
when nreturns is 0 and nparams is 1 or more I get this output:
[output]
nreturns = 1, nparams = 0, templated = true
has_returns.class = TrueClass, has_params.class = FalseClass,
templated2.class = Fixnum
has_returns = true, has_params = false, templated2 = 1
[/output]
Both 'templated2' and 'templated' should be true, not 0. I can't seem
to duplicate this in irb. Even in the debugger,
"p nreturns > 0 or nparams > 0" gives true, while "p templated" gives false.
This must be a bug in the interpreter is my guess? My ruby version is
1.8.4 win32.
Thanks,
~S