Le 03/09/2013 10:28, Henrik Johansen a écrit :
On Sep 2, 2013, at 4:41 , Goubier Thierry <[email protected]> wrote:
Le 02/09/2013 16:07, Stéphane Ducasse a écrit :
what we could do is to not deprecate now the methods?
Then we can deprecate them when we release 3.0
When starting pharo4? That would be perfect :)
I just noticed that Smalltalk os exist in 1.4 and 2.0. So my code should work
on an old image, isn't it? It would also work on 2.0 and 1.4, no?
(or something like (Smalltalk respondsTo: #os) ifTrue: [Smalltalk os name])
When was Smalltalk>>os introduced ?
Thierry
3.5 years ago ;)
http://forum.world.st/Worth-reading-discussion-on-Smalltalk-vs-SmalltalkImage-td1576291.html#a1576588
It's been included since Pharo 1.1/Squeak 4.1, so it's a reasonable default
path.
Though, better use Smalltalk os platformName (which should work in all versions since the
above mentioned), writing a test for whether #name is the "correct" method to
use ala 3.0 would be an interesting exercise since it's also implemented for older
returns of Smalltalk os, but with a different meaning. *cough* find a better selector for
3.0? *cough*
I think OSPlatform is one of those packages which tries to work on Squeak 3.6
and up, and in that case you still need more fallbacks.
Cheers,
Henry
Thanks Henry for the info.
However, I'm sure platformName (and platformSubtype) will be deprecated
in Pharo sooner or later... leaving us with another deprecation. At
least the deprecation warning seems to be pointing to that.
At the same time, parts of OSProcess seems to not be working under
Pharo2 anyway :( I don't even think I'm able to run the tests (locked up
my 3.0 image it did).
Looks like a version / implementation test would be the way to go. I'll
write something which should work on 2.0 / 3.0, and failure protection
to fallback for anything else.
Is there a standard way to test for implementation/version on all Squeak
and Pharo versions ?
Thierry
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95