Yeah, I thought that lambdas supported closures, so they hold their state and you can pass it around.<br><br>-Corey<br><br><div class="gmail_quote">On Jan 29, 2008 11:55 PM, Pat Maddox &lt;<a href="mailto:pergesu@gmail.com">pergesu@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Jan 29, 2008 8:48 PM, James B. Byrne &lt;<a href="mailto:byrnejb@harte-lyne.ca">byrnejb@harte-lyne.ca</a>&gt; wrote:<br>
&gt; Message-ID:&lt;<a href="mailto:ef1d468f0801291747q3f605e6cjb73028a888a441ee@mail.gmail.com">ef1d468f0801291747q3f605e6cjb73028a888a441ee@mail.gmail.com</a>&gt;<br>&gt;<br>&gt; On: Tue, 29 Jan 2008 20:47:41 -0500, &quot;Andrew WC Brown&quot; &lt;<a href="mailto:omen.king@gmail.com">omen.king@gmail.com</a>&gt;<br>
&gt; wrote:<br>&gt;<br>&gt; &gt; I&#39;ve seen lambda before but not sure what it does.<br>&gt;<br>&gt; A lambda is a fancy name for an anonymous or unbound function. &nbsp;Its<br>&gt; significance comes from the fact that it is completely stateless, producing no<br>
&gt; side effects to its returned result.<br><br></div>I don&#39;t know about that...<br><br>irb(main):001:0&gt; a = [1,2,3]<br>=&gt; [1, 2, 3]<br>irb(main):002:0&gt; def foo(array)<br>irb(main):003:1&gt; lambda { array.clear }<br>
irb(main):004:1&gt; end<br>=&gt; nil<br>irb(main):005:0&gt; fun = foo a<br>=&gt; #&lt;Proc:0x002842a4@(irb):3&gt;<br>irb(main):006:0&gt; fun.call<br>=&gt; []<br>irb(main):007:0&gt; a<br>=&gt; []<br><div><div></div><div class="Wj3C7c">
_______________________________________________<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.coreyhaines.com">http://www.coreyhaines.com</a><br>The Internet&#39;s Premiere source of information about Corey Haines