On Sep 4, 2013, at 4:52 AM, "David T. Lewis" <lewis@mail.msen.com> wrote:
On Tue, Sep 03, 2013 at 01:48:46PM +0200, Goubier Thierry wrote:
Le 03/09/2013 13:36, David T. Lewis a ?crit :
Can you post the method here first? I'd like to check it on some Squeak images before it goes into the repository.
Here it is (at least an example):
in OSProcess class
isPharo3AndLater "Test if we are on Pharo 3.0"
^ (Smalltalk classNamed: 'SystemVersion') ifNil: [ false ] ifNotNil: [ :v | v current type = 'Pharo' and: [ v current major >= 3 ] ]
The idea is right, but the details can be a PITA ;-)
- In Squeak trunk, class SystemVersion exists. But it does not understand #type, so this fails at runtime.
- There are no implementors of #major in Squeak (but this can be rewritten using #perform:).
- In Squeak 3.8, #ifNil:ifNotNil: requires a block with no arguments.
Why do you need to support Squeak 3.8? This is how many years old? I really do not understand this idea to be compatible to all old versions ever. In the end it will just make sure that no progress is possible at all. Marcus