This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_extPart_001_01C1D72E.CB7ABA90
Content-Type: text/plain;
	charsetso-8859-1"

Chris Gehlker [mailto:gehlker / fastq.com] wrote:
> Does anyone else think that the following little program is  an instance
of
> Ruby violating the POLS by producing nil? I can fix it by uncommenting the
> commented line but I don't think that that should be required.
> 
> def truthTest
>     result  rue
>     result  alse unless result
>     # return result
> end
> 
> p truthTest

Why is that so surprising? 

irb(main):001:0> result  rue
true
irb(main):002:0> result  alse unless result
nil
irb(main):003:0>

"The return value of a method is the value of the last expression executed."
-- so it is written (Pickaxe, bottom of page 230)

------_extPart_001_01C1D72E.CB7ABA90
Content-Type: text/html;
	charsetso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV
ontent-Type" CONTENText/html; charseto-8859-1"> <META NAMEenerator" CONTENTS Exchange Server version 5.5.2654.45"> <TITLE>RE: Now that's surprising.</TITLE> </HEAD> <BODY> <P><FONT SIZE Chris Gehlker [<A HREFailto:gehlker / fastq.com">mailto:gehlker / fastq.com</A>] wrote:</FONT> <BR><FONT SIZE &gt; Does anyone else think that the following little program is&nbsp; an instance of</FONT> <BR><FONT SIZE &gt; Ruby violating the POLS by producing nil? I can fix it by uncommenting the</FONT> <BR><FONT SIZE &gt; commented line but I don't think that that should be required.</FONT> <BR><FONT SIZE &gt; </FONT> <BR><FONT SIZE &gt; def truthTest</FONT> <BR><FONT SIZE &gt;&nbsp;&nbsp;&nbsp;&nbsp; result rue</FONT> <BR><FONT SIZE &gt;&nbsp;&nbsp;&nbsp;&nbsp; result alse unless result</FONT> <BR><FONT SIZE &gt;&nbsp;&nbsp;&nbsp;&nbsp; # return result</FONT> <BR><FONT SIZE &gt; end</FONT> <BR><FONT SIZE &gt; </FONT> <BR><FONT SIZE &gt; p truthTest</FONT> </P> <P><FONT SIZE Why is that so surprising? </FONT> </P> <P><FONT SIZE irb(main):001:0&gt; result rue</FONT> <BR><FONT SIZE true</FONT> <BR><FONT SIZE irb(main):002:0&gt; result alse unless result</FONT> <BR><FONT SIZE nil</FONT> <BR><FONT SIZE irb(main):003:0&gt;</FONT> </P> <P><FONT SIZE &quot;The return value of a method is the value of the last expression executed.&quot;</FONT> <BR><FONT SIZE -- so it is written (Pickaxe, bottom of page 230)</FONT> </P> </BODY> </HTML> ------_extPart_001_01C1D72E.CB7ABA90--