[Q] Compiler evaluate: question
Vladimir Janousek
janousek at fit.vutbr.cz
Wed May 21 20:54:02 UTC 2003
Vladimir Janousek wrote:
> Ned Konz wrote:
>
>> On Wednesday 21 May 2003 11:11 am, Vladimir Janousek wrote:
>>
>>> Unfortunately it does not help for example in this case:
>>>
>>> [ Compiler evaluate: 1 asCharacter asString ] ifError: []
>>>
>>> SyntaxError window apeaers.
>>>
>>> (Since the string is a result of decryption in my case, even such
>>> situations could be possible.)
>>
>>
>>
>> Make a subclass of StringHolder that understands #notify:at:in:
>> and do this:
>>
>> Compiler evaluate: 1 asCharacter asString notifying: myNewStringHolder
>> logged: false
>>
>> Or just accept that when it tries to notify you, there will be an error:
>>
>> [ Compiler evaluate: 1 asCharacter asString notifying: 'xxx' logged:
>> false ] ifError: []
>>
>
>
> Yes! That's it!
... but the last solution does not work with correct smalltalk
expressions because 'xxx' does not understand messages
#selectionInterval and #text which are sent to it (I don't know why).
Nevertheless, a MyController (StringHolder subclass) which understands
these two messages solve the problem. Other messages cause exceptions
which could be catched.
Ned and Derek, thanks for good advice.
Vladimir
More information about the Squeak-dev
mailing list
|