Re: When {integer:0} <> 0 ???
- From: Brian Candler <b.candler@xxxxxxxxx>
- Date: Mon, 5 Apr 2010 03:47:18 -0500
Richard Fairbanks wrote:
if p(Y.z): 0 # I assume this is the culprit!
osax.say(Y.z) #=> silence
end
What are you trying to do here?
What you've written is equivalent to
if p(Y.z)
0
osax.say(Y.z)
end
You haven't defined a method called p, so you get the standard Kernel#p
"p x" is like "puts x.inspect" and returns nil, which is treated as
false, so the code inside the if is not executed.
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: When {integer:0} <> 0 ???
- From: Richard Fairbanks
- Re: When {integer:0} <> 0 ???
- References:
- When {integer:0} <> 0 ???
- From: Richard Fairbanks
- When {integer:0} <> 0 ???
- Prev by Date: When {integer:0} <> 0 ???
- Next by Date: Re: undefined method `stringify_keys!' for #<Post:0xab67154>
- Previous by thread: When {integer:0} <> 0 ???
- Next by thread: Re: When {integer:0} <> 0 ???
- Index(es):