[Cuis-dev] Protocol Browser on the class side

Juan Vuletich juan at cuis.st
Mon Aug 7 11:32:00 PDT 2023


On 8/4/2023 9:46 AM, Szabolcs Komáromi via Cuis-dev wrote:
> Hi,
>
> The Protocol Browser doesn't work on metaclasses and from the 
> selectedClassOrMetaClass' comment ("I ignore metaClass, so..") looks 
> like this is the intended behavior. Is there any particular reason not 
> to support this scenario?
>
> Adding a test to the ProtoclolBrowser's selectedClass method to 
> check whether the looked up class is a metaclass ("baseClass isMeta") 
> seemingly works.
>> *selectedClass*
>> "Answer the class that is currently selected.
>> Answer base if no selection exists."
>> | className class |
>> className := self selectiveClassListIndex = 0
>> ifTrue: [ self selectiveClassList last ]
>> ifFalse: [ self selectiveClassList at: self selectiveClassListIndex ].
>> class := Smalltalk at: (className findTokens: ' ') first asSymbol.
>> baseClass isMeta
>> ifTrue: [ ^ class class ]
>> ifFalse: [ ^ class ].
> ...
> Regards,
> Szabolcs

Nice! I pushed this, followed by another update that makes 
#selectedClassOrMetaClass be consistent with other implementors in the 
hierarchy.

Thanks,

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230807/57b191dc/attachment.htm>


More information about the Cuis-dev mailing list