[squeak-dev] The Trunk: Network-fbs.142.mcz

tim Rowledge tim at rowledge.org
Thu Jul 25 16:54:50 UTC 2013


On 25-07-2013, at 12:49 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
>> 
>>  startUp
>> +       (Smalltalk platformName =  'Mac OS') ifTrue: [
>> -       (SmalltalkImage current platformName =  'Mac OS') ifTrue: [
>>                self useHTTPProxy ifTrue: [
>>                         (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p |
>>                                HTTPSocket useProxyServerNamed: p first port: p second asInteger]]]!
> 
> Checking for strings is... not the best thing you could do. I'd _much_
> rather see something like "Smalltalk platform isMacOS" or similar.

Definitely. But I'd suggest "Smalltalk platformIsMacOSX" so as to avoid somebody coming along and implementing a class SmalltalkPlatformDescription that is returned by #platform and responds to isMacOSX. Though a platform info class isn't a terrible idea as such, so long as it isn't spread all over the system. Like SystemNavigation - it's not a terrible thing to put allBehaviorsDo: etc into a class, so long as the main access is via something memorable - like Smalltalk allBehavioursDo:

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: SLTMDL: Shift Left, Test Mask and Dim the Lights




More information about the Squeak-dev mailing list