[Newbies] Re: Re: translateFrom:to:table:
Klaus D. Witzel
klaus.witzel at cobss.com
Sun Jul 30 01:51:35 UTC 2006
If some method is not just a thing hanging around waiting for nothing (no
senders, for example), you always will find its full implementation+use -
that's the nature of the Smalltalk/Squeak system.
senders of #translateFrom:to:table:
senders of #translateWith: (nice examples for what the table argument is
implementors of #translateFrom:to:table:
The String implementation tell exactly what argument is used for what,
same with the primitive fallback code of the ByteString implementation.
Hope that helps.
On Sun, 30 Jul 2006 00:45:43 +0200, Thomas Keller <thokeller at gmail.com>
> That works for lots of methods. But for some methods there are no decent
> comments or examples. This is what I get from "Senders of
> translateWith: table
> "translate the characters in the string by the given table, in place"
> ^ self translateFrom: 1 to: self size table: table
> I don't find see anything called "references".
> I cannot find a single example of what a table arguments should look
> Here's a simple example of what I want to do:
> myString := 'ACGTACGT'.
> myFixedString := myString translateFrom: 1 to; (myString size) table:
> Where table would be something like a hash: A => 5, G => 6, C => 7, T =>
> in Perl, I would write: perl -pe 'tr/AGCT/5678/' <return> on the command
> line and then paste in the string and perl would return the translated
> Thanks for your help.
> Tom Keller
> On 7/28/06, Klaus D. Witzel <klaus.witzel at cobss.com> wrote:
>> On Fri, 28 Jul 2006 20:49:13 +0200, Mathieu wrote:
>> > Hi thomas,
>> > You can find some sender of it by right click -> more.. -> senders of
>> And there is a way to avoid stinkin' right-click: in any text, select
>> text of a selector (including its arguments) and do cmd-m and cmd-n :)
>> example, in a browser with the class definition template (Object
>> #NameOfSubclass ...) do select from subclass: to category: and see what
>> > So you can understand how people use it.
>> Yes, one of the best ways to come to use to Smalltalk/Squeak.
>> > Other wise find the references to it and you can read comment of the
>> > metod or even understand the implementation. (follow same method for
>> > 'sender of it' but chose 'references to it')
>> > Math
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
More information about the Beginners