use of underscores in selectors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

use of underscores in selectors

douglas mcpherson
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:

 

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 


Reply | Threaded
Open this post in threaded view
|

Re: use of underscores in selectors

Eliot Miranda-2
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


On Wed, Jun 25, 2014 at 11:19 PM, Douglas McPherson <[hidden email]> 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:

 

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


Reply | Threaded
Open this post in threaded view
|

Re: use of underscores in selectors

Eliot Miranda-2



On Thu, Jun 26, 2014 at 11:05 AM, Eliot Miranda <[hidden email]> 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 <[hidden email]> 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:

 

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


Reply | Threaded
Open this post in threaded view
|

Re: use of underscores in selectors

douglas mcpherson
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.

Doug



On Jun 26, 2014, at 11:08 , Eliot Miranda wrote:




On Thu, Jun 26, 2014 at 11:05 AM, Eliot Miranda <[hidden email]> 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 <[hidden email]> 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




Reply | Threaded
Open this post in threaded view
|

Re: use of underscores in selectors

Eliot Miranda-2



On Thu, Jun 26, 2014 at 12:31 PM, Douglas McPherson <[hidden email]> 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
 

Doug



On Jun 26, 2014, at 11:08 , Eliot Miranda wrote:




On Thu, Jun 26, 2014 at 11:05 AM, Eliot Miranda <[hidden email]> 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 <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: use of underscores in selectors

douglas mcpherson

On Jun 26, 2014, at 12:40 , Eliot Miranda wrote:




On Thu, Jun 26, 2014 at 12:31 PM, Douglas McPherson <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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