Thanks
Cédrick...you are right; I don&#39;t know how I missed that one right there in the Method Finder...I can&#39;t seem to make your ctrl+alt+w trick work, though!&nbsp; Maybe I don&#39;t have something installed?<br><br>Rob<br><br>
<div class="gmail_quote">On Fri, May 30, 2008 at 7:08 PM, cdrick &lt;<a href="mailto:cdrick65@gmail.com">cdrick65@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;">
Hi Rob<br>
<br>
There is one method in SequenceableCollection (and in Set) that does<br>
what you want (same implementation as yours)...<br>
<br>
SequenceableCollection &gt;&gt;swap: oneIndex with: anotherIndex<br>
<br>
I found it by using ctrl+alt+w when swap selected (one of my favorite<br>
shortcut - for selectors containing it)<br>
<br>
Cheers<br>
<br>
Cédrick<br>
<br>
2008/5/31 Rob Rothwell &lt;<a href="mailto:r.j.rothwell@gmail.com">r.j.rothwell@gmail.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt; This is a curiosity question that will hopefully help me understand the<br>
&gt; Squeak *system* better.<br>
&gt;<br>
&gt; I have an Aida application in which I find myself doing a lot of list<br>
&gt; manipulation, and given the reputation Smalltalk has for the strength of<br>
&gt; it&#39;s collection classes, I felt sure I would find a method SOMEWHERE that<br>
&gt; exchanged two elements.<br>
&gt;<br>
&gt; So...am I just no good at finding what I&#39;m looking for (swap, exchange,<br>
&gt; move?), or is it because it is so simple to write something like<br>
&gt;<br>
&gt; exchange: index1 and: index2<br>
&gt; &nbsp; &nbsp; |temp|<br>
&gt; &nbsp; &nbsp; temp := self at: index1.<br>
&gt; &nbsp; &nbsp; self at: index1 put: (self at: index2).<br>
&gt; &nbsp; &nbsp; self at: index2 put: temp.<br>
&gt;<br>
&gt; that no one would even think of needing to include such behavior?<br>
&gt;<br>
&gt; Again, just wondering so I can &quot;measure&quot; my understanding of how little I<br>
&gt; know and better gauge whether I think I can find an answer from the system<br>
&gt; itself...<br>
&gt;<br>
&gt; Of course, the answer is probably &quot;why don&#39;t you just...&quot; along with a<br>
&gt; single line...!<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Rob<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Beginners mailing list<br>
&gt; <a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>