Andreas Wacknitz wrote:
Am 29.07.2009 um 21:13 schrieb Mariano Martinez Peck:
On Wed, Jul 29, 2009 at 6:06 PM, Andreas Wacknitz <A.Wacknitz@gmx.de <mailto:A.Wacknitz@gmx.de>> wrote:
Am 29.07.2009 um 20:08 schrieb Marcus Denker:
sooner or later. And I can't see that OSPlatform current isMacOSX is really that much better than SmalltalkImage current platformName = 'Mac OS'
Yes it is. I it is not MUCH better, but a bit better and easy to implement. Tomorrow the platform name changes and you have to change your code all over the image. At least, with this, you have the hardcoded in a single place. After this, with a single "senders" you can see where it is used and how to modify this for a more OO stuff.
I beg to disagree. First, you could also search for senders of "platformName". Second, what to do when you need to add a new platform? At the moment there is "isUnix". But there might be differences between Linux, Solaris, RiscOS, FreeBSD, ...
There can be considerable differences. e.g. the gnu tools used by Linux have different command line options from the BSD tools which could impact things like OSProcess.
You don't want a single search and multiple change but a single search AND change. In my opinion the proposed code is only a minor improvement.
Maybe one possible solution would be to select on features, e.g. something like PlatformFeatures>>#menuSupport? I believe Common Lisp does something like that with their *features* variable.