'Win 32' and others....

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

'Win 32' and others....

Stéphane Ducasse
What do you think about that?
I think that would be good.

Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']

This is not good to have all these strings to encode platform support.
We should move some code to SmalltalkImage

SmalltalkImage>>win32
         ^ 'Win 32'

SmalltalkImage>>isWin32CE
         ^ (self platformName = 'Win32' and: [self osVersion = 'CE'])

...

Stef
_______________________________________________
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: 'Win 32' and others....

Fernando olivero
+1

Kent beck smalltalk good practices book.


On Mar 17, 2010, at 9:11 PM, Stéphane Ducasse wrote:

> What do you think about that?
> I think that would be good.
>
> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>
> This is not good to have all these strings to encode platform support.
> We should move some code to SmalltalkImage
>
> SmalltalkImage>>win32
>         ^ 'Win 32'
>
> SmalltalkImage>>isWin32CE
>         ^ (self platformName = 'Win32' and: [self osVersion = 'CE'])
>
> ...
>
> Stef
> _______________________________________________
> 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: 'Win 32' and others....

Nicolas Cellier
In reply to this post by Stéphane Ducasse
2010/3/17 Stéphane Ducasse <[hidden email]>:

> What do you think about that?
> I think that would be good.
>
> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>
> This is not good to have all these strings to encode platform support.
> We should move some code to SmalltalkImage
>
> SmalltalkImage>>win32
>         ^ 'Win 32'
>
> SmalltalkImage>>isWin32CE
>         ^ (self platformName = 'Win32' and: [self osVersion = 'CE'])
>
> ...
>

Concerning readability, both are readable.
Concerning discovering capability (what are all specific Win32CE
features in the image ?), the message is easier to track than the
String.
Concerning maintenance (hability to change implementation
details/features), the message is clearly superior.

For example, I can imagine you buy a device that isWin32CECompatible.
OK, bad example it's more past than future ;)

Nicolas

> Stef
> _______________________________________________
> 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: 'Win 32' and others....

Stéphane Ducasse
:)
I was concerned about 'win32' versus 'Win 32' versus 'Win32'
I'm having fun (really) rewriting by hand all the SmalltalkImage current and I reading the code and fixing it.
This is cool I'm learning a lot of simple stuff.

Stef

>> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>>
>> This is not good to have all these strings to encode platform support.
>> We should move some code to SmalltalkImage
>>
>> SmalltalkImage>>win32
>>         ^ 'Win 32'
>>
>> SmalltalkImage>>isWin32CE
>>         ^ (self platformName = 'Win32' and: [self osVersion = 'CE'])
>>
>> ...
>>
>
> Concerning readability, both are readable.
> Concerning discovering capability (what are all specific Win32CE
> features in the image ?), the message is easier to track than the
> String.
> Concerning maintenance (hability to change implementation
> details/features), the message is clearly superior.
>
> For example, I can imagine you buy a device that isWin32CECompatible.
> OK, bad example it's more past than future ;)
>
> Nicolas
>
>> Stef
>> _______________________________________________
>> 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


_______________________________________________
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: 'Win 32' and others....

Nicolas Cellier
2010/3/17 Stéphane Ducasse <[hidden email]>:
> :)
> I was concerned about 'win32' versus 'Win 32' versus 'Win32'
> I'm having fun (really) rewriting by hand all the SmalltalkImage current and I reading the code and fixing it.
> This is cool I'm learning a lot of simple stuff.
>
> Stef
>

That's why I tend to avoid automated scripts. You always want to
rewrite more than you thought !
At least, I try to review changed methods, there's always something to learn.

Nicolas

>>> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>>>
>>> This is not good to have all these strings to encode platform support.
>>> We should move some code to SmalltalkImage
>>>
>>> SmalltalkImage>>win32
>>>         ^ 'Win 32'
>>>
>>> SmalltalkImage>>isWin32CE
>>>         ^ (self platformName = 'Win32' and: [self osVersion = 'CE'])
>>>
>>> ...
>>>
>>
>> Concerning readability, both are readable.
>> Concerning discovering capability (what are all specific Win32CE
>> features in the image ?), the message is easier to track than the
>> String.
>> Concerning maintenance (hability to change implementation
>> details/features), the message is clearly superior.
>>
>> For example, I can imagine you buy a device that isWin32CECompatible.
>> OK, bad example it's more past than future ;)
>>
>> Nicolas
>>
>>> Stef
>>> _______________________________________________
>>> 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
>
>
> _______________________________________________
> 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: 'Win 32' and others....

Michael Rueger-6
In reply to this post by Stéphane Ducasse
On 3/17/10 1:11 PM, Stéphane Ducasse wrote:
> What do you think about that?
> I think that would be good.
>
> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>
> This is not good to have all these strings to encode platform support.
> We should move some code to SmalltalkImage

isn't that what the OSPlatform classes are meant to do?

Michael

_______________________________________________
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: 'Win 32' and others....

Stéphane Ducasse
No idea but they all check

        Smalltalk platformName = 'Win32'

with strings

        and sometimes even
                (Smalltalk getSystemAttribute: 1001) = 'Win32'
        I prefer

                Smalltalk isWin32

But I think that we can do better and probably in the future.
Smalltalk should be a bridge to real class like platform that will contain this code.

        Smalltalk platform isWin32

Right now let us try to avoid this strings everywhere.

Stef
 

On Mar 18, 2010, at 9:38 PM, Michael Rueger wrote:

> On 3/17/10 1:11 PM, Stéphane Ducasse wrote:
>> What do you think about that?
>> I think that would be good.
>>
>> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion = 'CE']
>>
>> This is not good to have all these strings to encode platform support.
>> We should move some code to SmalltalkImage
>
> isn't that what the OSPlatform classes are meant to do?
>
> Michael
>
> _______________________________________________
> 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: 'Win 32' and others....

Nicolas Cellier
In reply to this post by Michael Rueger-6
2010/3/18 Michael Rueger <[hidden email]>:

> On 3/17/10 1:11 PM, Stéphane Ducasse wrote:
>>
>> What do you think about that?
>> I think that would be good.
>>
>> Issue 2159: We should clean all the platformName = 'Win32' and: [osVersion
>> = 'CE']
>>
>> This is not good to have all these strings to encode platform support.
>> We should move some code to SmalltalkImage
>
> isn't that what the OSPlatform classes are meant to do?
>
> Michael

Should Smalltalk os redirect to current OSPlatform ?

>
> _______________________________________________
> 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: 'Win 32' and others....

Stéphane Ducasse
>>
>
> Should Smalltalk os redirect to current OSPlatform ?

probably something like that (at least I had in mind).
But right I should finish the smalltalkImage migration and the pending issue.
As well as fighting with the wrong root password on our server :(
Stef

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