On Tue, Jan 22, 2013 at 08:05:02PM +0100, Marcus Denker wrote:
On Jan 22, 2013, at 5:27 PM, H. Hirzel <hannes.hirzel@gmail.com> wrote:
Dave
I wonder why you can't check for
Smalltalk at: #OSPlatform
and if that exists go for OSPlatform osVersion
We deprecated that? but I can un-deprecate.
Neither Squeak nor Cuis do have an OSPlatform class.
Then you go for Smalltalk os version
This works in Pharo 2.0?
Yes, "Smalltalk os version" is right for Pharo 2.0. I'm looking for a way to modify the following method so that it adds support for Pharo 2.0, so that it continues to work in the other images, and so that it does not raise deprecation warnings or DNUs in any of the images. OSProcess class>>osVersion "After Squeak version 3.6, #osVersion was moved to SmalltalkImage. Some versions of Pharo move this to OSPlatform and issue deprecation warnings about the other usages." ^ (((Smalltalk hasClassNamed: #OSPlatform) and: [(Smalltalk at: #OSPlatform) respondsTo: #osVersion]) ifTrue: [Smalltalk at: #OSPlatform] ifFalse: [((Smalltalk classNamed: 'SmalltalkImage') ifNil: [^ Smalltalk osVersion]) current]) osVersion Dave
Am I missing something here?
--Hannes
On 1/21/13, David T. Lewis <lewis@mail.msen.com> wrote:
Why is OSPlatform class>>osVersion deprecated but OSPlatform class>>platformName is not?
My suggestion would be to comment #osVersion as being a synonym for #version, but do not deprecate it. That would enable use of "Smalltalk os version", and it would also support "OSPlatform osVersion", both of which make logical sense. It would also maintain support for external packages that rely on #osVersion to figure out platform differences.
The reason that I am asking is that I am trying to find a way to make OSProcess class>>osVersion work on Pharo 2.0, Pharo1.x, and the various versions of Squeak and Cuis. I quite honestly cannot figure out any way to add Pharo 2.0 without breaking one more more of the other supported images. If OSPlatform class>>osVersion did not raise a deprecation warning, then I could make it work.
Thanks, Dave