<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vidul Nikolaev Petrov &#187; basis</title>
	<atom:link href="http://www.vidul.com/category/ruby/basis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Thu, 09 Sep 2010 22:51:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How false Is nil</title>
		<link>http://www.vidul.com/2008/08/04/how-false-is-nil/</link>
		<comments>http://www.vidul.com/2008/08/04/how-false-is-nil/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 14:59:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[basis]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Use nil when the return is a boolean value.
Use false when the return is either false or not true object.
Otherwise they have pretty much the same semantic:

nil == false =&#62; false
nil.nil?        =&#62; true
false.nil?     =&#62; false
true.nil?      =&#62; false
&#160;
if !nil &#38;&#38; [...]]]></description>
			<content:encoded><![CDATA[<p>Use <strong>nil</strong> when the return is a boolean value.<br />
Use <strong>false</strong> when the return is either <strong>false</strong> or not <strong>true</strong> object.<br />
<em>Otherwise they have pretty much the same semantic:</em></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#0000FF; font-weight:bold;">nil</span> == <span style="color:#0000FF; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#0000FF; font-weight:bold;">nil</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?        <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#0000FF; font-weight:bold;">false</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#0000FF; font-weight:bold;">true</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?      <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> !<span style="color:#0000FF; font-weight:bold;">nil</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> !<span style="color:#0000FF; font-weight:bold;">false</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'true'</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0000FF; font-weight:bold;">nil</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> !<span style="color:#0000FF; font-weight:bold;">true</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'true'</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#CC00FF; font-weight:bold;">TrueClass</span>.<span style="color:#9900CC;">ancestors</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC00FF; font-weight:bold;">TrueClass</span>, <span style="color:#CC00FF; font-weight:bold;">Object</span>, <span style="color:#CC00FF; font-weight:bold;">Kernel</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#CC00FF; font-weight:bold;">FalseClass</span>.<span style="color:#9900CC;">ancestors</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC00FF; font-weight:bold;">FalseClass</span>, <span style="color:#CC00FF; font-weight:bold;">Object</span>, <span style="color:#CC00FF; font-weight:bold;">Kernel</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> <span style="color:#CC00FF; font-weight:bold;">NilClass</span>.<span style="color:#9900CC;">ancestors</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC00FF; font-weight:bold;">NilClass</span>, <span style="color:#CC00FF; font-weight:bold;">Object</span>, <span style="color:#CC00FF; font-weight:bold;">Kernel</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p><a href="http://www.ruby-doc.org/core/">Ruby core docs</a></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;Title=How+false+Is+nil" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;title=How+false+Is+nil" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;title=How+false+Is+nil" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;title=How+false+Is+nil" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;title=How+false+Is+nil" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2008/08/04/how-false-is-nil/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=How+false+Is+nil+-+http://b2l.me/bmcxg+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2008/08/04/how-false-is-nil/&amp;h=How+false+Is+nil" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2008/08/04/how-false-is-nil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
