[Newbies] asUppercase doesn't work
btc at openinworld.com
Thu Mar 9 02:27:33 UTC 2017
On Thu, Mar 9, 2017 at 5:07 AM, Joseph Alotta <joseph.alotta at gmail.com> wrote:
> It works for me (I did this in the workspace) :
> 'test' class ==> ByteString
> 'test' asUppercase ==> ‘TEST'
> It is difficult to tell from your email what is the problem. I would
> recommend that you test little things like
> this in a workspace window. I am suspecting that your method is not being
> called in the way you think it is.
>> On Mar 8, 2017, at 1:21 PM, alaztetik [via Smalltalk] <[hidden email]>
>> Hi everbody,
>> It is nice to be here with you. This is my first post and I'm very
>> I'm reading "Squeark by Example" book and encountered an interesting
>> I created a method named "testString" and here is its content:
>> ^self asUppercase, '!'.
>> When I test it, it doesn't work and gives this error:
What class is reported as not understanding #asUpperCase ?
Given that your method starts with "test..."
I'd expect its in a class that is subclassed from TestCase.
But if you look at the "Implementors" of #asUpperCase (select the text
and hit <CTRL-M>)
you'll see #asUpperCase is only understood by Character, String & WideString.
So is "self" a-TestCase ?
To investigate, you can put a "self halt" at the top of the method,
and in the debugger, select self and "Inspect it".
btw, Can you supply a link and page reference for Squeak by Example?
>> But when I replace the text:
>> ^self opy asString translateToUppercase, '!'
>> It works! Where am I making a mistake?
>> If you reply to this email, your message will be added to the discussion
>> To start a new topic under Squeak - Beginners, email [hidden email]
>> To unsubscribe from Squeak - Beginners, click here.
More information about the Beginners