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