Styler?

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

Styler?

stephane ducasse
Hi guys

what do we do with shout?
Squeak introduced it directly in the system. Now I was thinking that what could be a solution is to have a
default API/null pattern class that could be in the core and that when Shout gets loaded the shout class is used instead.
Now we could add Shout to the TextEditor package but I would like to understand how we can do it without.
And also it is interesting to see if one day we will need selector namespace or something like that to deal well with extensions.
Stef

in PharoCore-1.1 11367

Fails as CodeMorph#stylerClass is not initialized. And no *Styler* class
exists on PharoCore....

To make test passes on Pharo I've written

CodeMorph#defaultStylerClass  
  ^ SHTextStylerST80

CodeMorph#stylerClass  
  ^ stylerClass ifNil: [stylerClass := self defaultStylerClass].

the solution proposed by laurent only works when shout is loaded and this is not always the case.



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Styler?

Mariano Martinez Peck


On Sat, May 22, 2010 at 10:09 AM, stephane ducasse <[hidden email]> wrote:
Hi guys

what do we do with shout?
Squeak introduced it directly in the system. Now I was thinking that what could be a solution is to have a
default API/null pattern class that could be in the core and that when Shout gets loaded the shout class is used instead.

Wasn't this the idea of ToolSet ?  but sucks...(as we said few threads ago)
 
Now we could add Shout to the TextEditor package but I would like to understand how we can do it without.

This is an excellent question and idea. Using some kind of Strategy pattern or similar may help.
But I 9999999999^9999999  not to put Shout neither Style in Core ;)

I haven't look anything about the code. I have no idea. But cannot CodeMorph or whatever have a class variable that holds the Styler?
Then we create, as you said, a NullStyler for core. Shout implements its own Styler and when loaded, it does:
CodeMorph styler: ShoutStyler  or similar.

I guess the NullStyler is better than having to do everywhere  codeMorph styler isNil ifFalse: [ ....

Cheers

Mariano
 
 
And also it is interesting to see if one day we will need selector namespace or something like that to deal well with extensions.
Stef

in PharoCore-1.1 11367

Fails as CodeMorph#stylerClass is not initialized. And no *Styler* class
exists on PharoCore....

To make test passes on Pharo I've written

CodeMorph#defaultStylerClass
 ^ SHTextStylerST80

CodeMorph#stylerClass
 ^ stylerClass ifNil: [stylerClass := self defaultStylerClass].

the solution proposed by laurent only works when shout is loaded and this is not always the case.



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Styler?

Lukas Renggli
Why is a NullStyler necessary when Shout can load without overriding any code?

Lukas

2010/5/22 Mariano Martinez Peck <[hidden email]>:

>
>
> On Sat, May 22, 2010 at 10:09 AM, stephane ducasse
> <[hidden email]> wrote:
>>
>> Hi guys
>>
>> what do we do with shout?
>> Squeak introduced it directly in the system. Now I was thinking that what
>> could be a solution is to have a
>> default API/null pattern class that could be in the core and that when
>> Shout gets loaded the shout class is used instead.
>
> Wasn't this the idea of ToolSet ?  but sucks...(as we said few threads ago)
>
>>
>> Now we could add Shout to the TextEditor package but I would like to
>> understand how we can do it without.
>
> This is an excellent question and idea. Using some kind of Strategy pattern
> or similar may help.
> But I 9999999999^9999999  not to put Shout neither Style in Core ;)
>
> I haven't look anything about the code. I have no idea. But cannot CodeMorph
> or whatever have a class variable that holds the Styler?
> Then we create, as you said, a NullStyler for core. Shout implements its own
> Styler and when loaded, it does:
> CodeMorph styler: ShoutStyler  or similar.
>
> I guess the NullStyler is better than having to do everywhere  codeMorph
> styler isNil ifFalse: [ ....
>
> Cheers
>
> Mariano
>
>
>>
>> And also it is interesting to see if one day we will need selector
>> namespace or something like that to deal well with extensions.
>> Stef
>>
>> in PharoCore-1.1 11367
>>
>> Fails as CodeMorph#stylerClass is not initialized. And no *Styler* class
>> exists on PharoCore....
>>
>> To make test passes on Pharo I've written
>>
>> CodeMorph#defaultStylerClass
>>  ^ SHTextStylerST80
>>
>> CodeMorph#stylerClass
>>  ^ stylerClass ifNil: [stylerClass := self defaultStylerClass].
>>
>> the solution proposed by laurent only works when shout is loaded and this
>> is not always the case.
>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Styler?

Stéphane Ducasse
The problem is with CodeMorph lukas. It requires a styler. in the past it was hardcoding a ref to SHTextStylerST80
I removed it and I added an instance variable stylerClass. But now it means that this is the responsibility of the client to
specify the styler and having one by default would be nice.

Stef



On May 22, 2010, at 12:13 PM, Lukas Renggli wrote:

> Why is a NullStyler necessary when Shout can load without overriding any code?
>
> Lukas
>
> 2010/5/22 Mariano Martinez Peck <[hidden email]>:
>>
>>
>> On Sat, May 22, 2010 at 10:09 AM, stephane ducasse
>> <[hidden email]> wrote:
>>>
>>> Hi guys
>>>
>>> what do we do with shout?
>>> Squeak introduced it directly in the system. Now I was thinking that what
>>> could be a solution is to have a
>>> default API/null pattern class that could be in the core and that when
>>> Shout gets loaded the shout class is used instead.
>>
>> Wasn't this the idea of ToolSet ?  but sucks...(as we said few threads ago)
>>
>>>
>>> Now we could add Shout to the TextEditor package but I would like to
>>> understand how we can do it without.
>>
>> This is an excellent question and idea. Using some kind of Strategy pattern
>> or similar may help.
>> But I 9999999999^9999999  not to put Shout neither Style in Core ;)
>>
>> I haven't look anything about the code. I have no idea. But cannot CodeMorph
>> or whatever have a class variable that holds the Styler?
>> Then we create, as you said, a NullStyler for core. Shout implements its own
>> Styler and when loaded, it does:
>> CodeMorph styler: ShoutStyler  or similar.
>>
>> I guess the NullStyler is better than having to do everywhere  codeMorph
>> styler isNil ifFalse: [ ....
>>
>> Cheers
>>
>> Mariano
>>
>>
>>>
>>> And also it is interesting to see if one day we will need selector
>>> namespace or something like that to deal well with extensions.
>>> Stef
>>>
>>> in PharoCore-1.1 11367
>>>
>>> Fails as CodeMorph#stylerClass is not initialized. And no *Styler* class
>>> exists on PharoCore....
>>>
>>> To make test passes on Pharo I've written
>>>
>>> CodeMorph#defaultStylerClass
>>>  ^ SHTextStylerST80
>>>
>>> CodeMorph#stylerClass
>>>  ^ stylerClass ifNil: [stylerClass := self defaultStylerClass].
>>>
>>> the solution proposed by laurent only works when shout is loaded and this
>>> is not always the case.
>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project