<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Using a Stack with Ruby</title>
	<atom:link href="http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html/feed" rel="self" type="application/rss+xml" />
	<link>http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html</link>
	<description>Tips, tools and code for iPhone and Mac developers.</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:06:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: tpy</title>
		<link>http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html/comment-page-1#comment-11643</link>
		<dc:creator>tpy</dc:creator>
		<pubDate>Mon, 03 Oct 2011 00:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html#comment-11643</guid>
		<description>Greetings,

Since the method in the Stack class are all offered by nature Array class in ruby standard lib, why would we need to implement a &quot;Stack&quot;? Maybe Array.new() is already a full-functioned stack =)</description>
		<content:encoded><![CDATA[<p>Greetings,</p>
<p>Since the method in the Stack class are all offered by nature Array class in ruby standard lib, why would we need to implement a &#8220;Stack&#8221;? Maybe Array.new() is already a full-functioned stack =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: klaus</title>
		<link>http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html/comment-page-1#comment-897</link>
		<dc:creator>klaus</dc:creator>
		<pubDate>Thu, 10 Sep 2009 13:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html#comment-897</guid>
		<description>Hi,

if you return self in &quot;push&quot; and &quot;pop&quot; like
  def push(item)
    @the_stack.push item
    return self
  end
you can do interesting things like

stack.push(3).push(5)

and test stack laws like

stack.push(3).pop() == stack

OK, for the latter equality you also need an equals-method for the stack class. 
By the way, do you see a &quot;correct&quot; way to restrict stacks to certain data types, like e.g. in Java: Stack?

klaus</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>if you return self in &#8220;push&#8221; and &#8220;pop&#8221; like<br />
  def push(item)<br />
    @the_stack.push item<br />
    return self<br />
  end<br />
you can do interesting things like</p>
<p>stack.push(3).push(5)</p>
<p>and test stack laws like</p>
<p>stack.push(3).pop() == stack</p>
<p>OK, for the latter equality you also need an equals-method for the stack class.<br />
By the way, do you see a &#8220;correct&#8221; way to restrict stacks to certain data types, like e.g. in Java: Stack?</p>
<p>klaus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html/comment-page-1#comment-298</link>
		<dc:creator>john</dc:creator>
		<pubDate>Wed, 11 Jun 2008 12:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html#comment-298</guid>
		<description>James, you are welcome to share any of the tips you find here. All that I ask is that you make a reference (a link if possible) back to the original tip.</description>
		<content:encoded><![CDATA[<p>James, you are welcome to share any of the tips you find here. All that I ask is that you make a reference (a link if possible) back to the original tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Branam</title>
		<link>http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html/comment-page-1#comment-296</link>
		<dc:creator>James Branam</dc:creator>
		<pubDate>Wed, 11 Jun 2008 12:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://MacDeveloperTips.com/ruby/using-a-stack-with-ruby.html#comment-296</guid>
		<description>Hi again,
 This would also be a great contribution to NB Comm Docs. Can we use it?

Thanks,

--James</description>
		<content:encoded><![CDATA[<p>Hi again,<br />
 This would also be a great contribution to NB Comm Docs. Can we use it?</p>
<p>Thanks,</p>
<p>&#8211;James</p>
]]></content:encoded>
	</item>
</channel>
</rss>

