[squeak-dev] use of underscores in selectors
Douglas McPherson
djm1329 at san.rr.com
Fri Jun 27 00:42:47 UTC 2014
On Jun 26, 2014, at 12:40 , Eliot Miranda wrote:
>
>
>
> On Thu, Jun 26, 2014 at 12:31 PM, Douglas McPherson <djm1329 at san.rr.com> wrote:
> The pop-up is a result of a failing test in:
>
> CodeHolder>>
> validateMessageSource: sourceString forSelector: aSelector inClass: theClass
> "Check whether there is evidence that method source is invalid"
>
> (theClass newParser parseSelector: sourceString asString) = aSelector
> ifFalse: [self informPossiblyCorruptSource].
>
> In my example, the source string is 'ba_z ^true'. However, the result of #parseSelector: is #ba but the selector is actually #'ba_z'. So the test fails resulting in 'self #informPossiblyCorruptSource'.
>
> However, I can successfully doIt:
> 'Bar new ba_z' ==> true
> meaning that the selector is recognized in this case.
>
> So, Parser>>#parseSelector doesn't understand the underscore, but I'm in unfamiliar territory here.
>
> fixed in Compiler-eem.284
Thanks Eliot! Works fine now.
Doug
>
>
> Doug
>
>
>
> On Jun 26, 2014, at 11:08 , Eliot Miranda wrote:
>
>>
>>
>>
>> On Thu, Jun 26, 2014 at 11:05 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> Hi Doug,
>>
>> this is going to be either Shout or Text>>makeSelectorBoldIn: that need changes, probably the latter. The latter probably needs to just accept selectors containing underscores. Shout would need to obey the preference. HTH
>>
>> hmmm, this works: 'i_contain_underscores ^self' asText makeSelectorBoldIn: UndefinedObject
>>
>> So can you show a stack trace? e.g. by replacing the pop-up with a halt?
>>
>>
>>
>> On Wed, Jun 25, 2014 at 11:19 PM, Douglas McPherson <djm1329 at san.rr.com> wrote:
>> I want to use underscores in the selectors which define external functions, to match the external function name as much as possible. So I checked the preference "allowUnderscoreSelectors". I can define and use such selectors, however each time I browse a method whose selector has an underscore, I get the attached modal pop-up:
>>
>> <UserDialogBox.png>
>>
>> This seems to happen in both 4.4 and 4.5.
>>
>> Is there something else I am supposed to do to properly enable underscores in selectors?
>>
>> Thanks,
>> Doug
>>
>>
>>
>>
>>
>>
>> --
>> best,
>> Eliot
>>
>>
>>
>> --
>> best,
>> Eliot
>>
>
>
>
>
>
>
>
> --
> best,
> Eliot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140626/f7b46748/attachment.htm
More information about the Squeak-dev
mailing list
|