Hi Nicolai.
Now your proposals in slice 17496
<https://pharo.fogbugz.com/f/cases/17496/add-table-for-all-defined-method-selectors-and-use-it-in-code-completion-and-syntax-highlighting>
.
We change it a little bit: we make SelectorsTable lazy. And code completion
uses it too.

2016-01-16 22:17 GMT+01:00 Nicolai Hess <[email protected]>:

>
>
> 2016-01-16 13:46 GMT+01:00 Marcus Denker <[email protected]>:
>
>>
>> On 16 Jan 2016, at 13:26, Nicolai Hess <[email protected]> wrote:
>>
>>
>>
>> 2016-01-16 10:11 GMT+01:00 Marcus Denker <[email protected]>:
>>
>>>
>>> anyone an idea?
>>>
>>> I'm trying to think.
>>> Looks like it would be good to be able to make a distinction between
>>> symbols and selectors (selectors installed
>>> in method dictionaries)
>>>
>>>
>>> yes, this would improve code completion a bit, too, as there are more
>>> symbols than symbols that are actually names
>>> of methods.
>>>
>>> The data could be created per environment (Smalltalk globals) the first
>>> time and then cached till shutdown.
>>> (it would be an array of size 46451, pointing to existing symbols).
>>>
>>> The environment could cache sent selectors, too… pablo did an experiment
>>> with that.
>>>
>>> Marcus
>>>
>>>
>> How about a new SymbolTable "SelectorTable" that gets new entries on
>> every method compilation ?
>>
>>
>> maybe better when a method is added to a Method Dictionary? This way even
>> adding things the strange
>> way would work...
>>
>
> I tried some methods from TBehavior basicAddSelector:withMethod:
> but for example Nautilus, directly modifies method dict
>
>
>>
>>
>> I hacked a simple experimental version.
>> But I don't yet understand the workflow for initialisation of the Symbol
>> class (with rehash, interned, and compacting).
>>
>>
>> If we hook into adding methods, then compactSymbolTable and rehash could
>> just reset the SelectorTable and fill it after by going over all methods…
>>
>
>
> see attached changesets.
>
> load with:
>
> DangerousClassNotifier disableDuring:[
>     String subclass: #Symbol
>     instanceVariableNames: ''
>     classVariableNames: 'NewSymbols OneCharacterSymbols SymbolTable
> SelectorTable'
>     package: 'Collections-Strings'
>     ].
>
> DangerousClassNotifier disableDuring:[
> 'selectortable.1.cs'
> asFileReference fileIn.
>     ].
> Symbol initSelectorTable.
> 'use_selector_table.cs' asFileReference fileIn.
>
> what do you think ?
>
> (selectortable.cs defines SelectorTable and some methods in Symbol and
> String)
> (use_selector_table adds selectors as internedSelectorSymbol if this
> selector is set as a selector on CompiledMethod
> and uses findInternedSelector .... in RubStyler visitMessageNode)
>
>
>>
>>
>> Marcus
>>
>>
>

Reply via email to