Smalltalk>>#platformName

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk>>#platformName

Chris Muller-4
I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:

    Smalltalk platformName = "Mac OS" 
       ifTrue: 
          [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]

Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?

Still others check for "Risc OS" or "unix".  So, the full list I have so far is:

    unix
    Win32
    Mac OS
    Risc OS

If you know of any others, please let me know.

 - Chris


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

timrowledge
Bravo for tackling this. It's certainly a bit of a mess. Not quite the sort of 'bit of a mess' that, say, Brexit is, but still.


> On 2019-10-21, at 6:10 PM, Chris Muller <[hidden email]> wrote:
>
> I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:
>
>     Smalltalk platformName = "Mac OS"
>        ifTrue:
>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]
>
> Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?
>
> Still others check for "Risc OS" or "unix".  So, the full list I have so far is:
>
>     unix
>     Win32
>     Mac OS
>     Risc OS
>
> If you know of any others, please let me know.
>
>  - Chris
>


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Romani quidem artem amatoriam invenerunt. = You know, the Romans invented the art of love.



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

Squeak - Dev mailing list
In reply to this post by Chris Muller-4
I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?

/————————————————————/
For encrypted mail use [hidden email]
Get a free account at ProtonMail.com
Web: www.objectnets.net and www.objectnets.org

On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:


I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:

    Smalltalk platformName = "Mac OS" 
       ifTrue: 
          [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]

Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?

Still others check for "Risc OS" or "unix".  So, the full list I have so far is:

    unix
    Win32
    Mac OS
    Risc OS

If you know of any others, please let me know.

 - Chris



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

fniephaus
Considering there's quite some code relying on `Smalltalk platformName = 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might want to clean this up, but it will be hard to provide backward compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])

Fabio


On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <[hidden email]> wrote:
I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?

/————————————————————/
For encrypted mail use [hidden email]
Get a free account at ProtonMail.com

On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:


I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:

    Smalltalk platformName = "Mac OS" 
       ifTrue: 
          [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]

Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?

Still others check for "Risc OS" or "unix".  So, the full list I have so far is:

    unix
    Win32
    Mac OS
    Risc OS

If you know of any others, please let me know.

 - Chris




Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

Tobias Pape

> On 22.10.2019, at 10:17, Fabio Niephaus <[hidden email]> wrote:
>
> Considering there's quite some code relying on `Smalltalk platformName = 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might want to clean this up, but it will be hard to provide backward compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])
>

Win32 is the correct name, irrespective of 64/32 bit executables.

Best regards
        -Tobias

> Fabio
>
> [1] https://github.com/hpi-swa/graalsqueak/blob/9ce025f5f891a6369881551897e39a604cd6e617/src/de.hpi.swa.graal.squeak/src/de/hpi/swa/graal/squeak/util/OSDetector.java#L37
>
> On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <[hidden email]> wrote:
> I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?
>
> /————————————————————/
> For encrypted mail use [hidden email]
> Get a free account at ProtonMail.com
> Web: www.objectnets.net and www.objectnets.org
>
>> On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:
>>
>> 
>> I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:
>>
>>     Smalltalk platformName = "Mac OS"
>>        ifTrue:
>>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]
>>
>> Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?
>>
>> Still others check for "Risc OS" or "unix".  So, the full list I have so far is:
>>
>>     unix
>>     Win32
>>     Mac OS
>>     Risc OS
>>
>> If you know of any others, please let me know.
>>
>>  - Chris
>>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

Nicolas Cellier
Please consider if the work done in Pharo OSPlatform may fit.
Otherwise, maintaining multi-dialect compatibility becomes harder than necessary.


Le mar. 22 oct. 2019 à 10:21, Tobias Pape <[hidden email]> a écrit :

> On 22.10.2019, at 10:17, Fabio Niephaus <[hidden email]> wrote:
>
> Considering there's quite some code relying on `Smalltalk platformName = 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might want to clean this up, but it will be hard to provide backward compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])
>

Win32 is the correct name, irrespective of 64/32 bit executables.

Best regards
        -Tobias

> Fabio
>
> [1] https://github.com/hpi-swa/graalsqueak/blob/9ce025f5f891a6369881551897e39a604cd6e617/src/de.hpi.swa.graal.squeak/src/de/hpi/swa/graal/squeak/util/OSDetector.java#L37
>
> On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <[hidden email]> wrote:
> I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?
>
> /————————————————————/
> For encrypted mail use [hidden email]
> Get a free account at ProtonMail.com
> Web: www.objectnets.net and www.objectnets.org
>
>> On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:
>>
>> 
>> I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:
>>
>>     Smalltalk platformName = "Mac OS"
>>        ifTrue:
>>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]
>>
>> Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?
>>
>> Still others check for "Risc OS" or "unix".  So, the full list I have so far is:
>>
>>     unix
>>     Win32
>>     Mac OS
>>     Risc OS
>>
>> If you know of any others, please let me know.
>>
>>  - Chris
>>
>
>





Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

David T. Lewis
The platform-testing methods in OSProcess are:
 
   #isUnix
   #isUnixMac
   #isNonUnixMac
   #isWindows
   #isOS2
   #isRiscOS

These methods cover enough of the known variations of "platform name"
to serve the needs of the OSProcess/CommandShell packages.

I'm sure you will also enjoy reading this:
 
OSProcess class>>platformName
   "After Squeak version 3.6, #platformName was moved to SmalltalkImage Some
   versions of Pharo move this to OSPlatform and issue deprecation warnings
   about the other usages. The original idiom (Squeak 3.6 and earlier) is the sensible
   default, but here we attempt to support other implementations if the sensible
   default is not available."

   "OSProcess platformName"

   (Smalltalk respondsTo: #platformName)
      ifTrue: [^ Smalltalk platformName].
   self isPharo3AndLater
      ifTrue: [ ^ (Smalltalk perform: #os) name ].
   ^ (((Smalltalk hasClassNamed: #OSPlatform)
         and: [(Smalltalk at: #OSPlatform)
               respondsTo: #platformName])
      ifTrue: [Smalltalk at: #OSPlatform]
      ifFalse: [((Smalltalk classNamed: 'SmalltalkImage')
            ifNil: [^ Smalltalk osVersion]) current]) platformName


Dave


On Tue, Oct 22, 2019 at 11:06:50AM +0200, Nicolas Cellier wrote:

> Please consider if the work done in Pharo OSPlatform may fit.
> Otherwise, maintaining multi-dialect compatibility becomes harder than
> necessary.
>
>
> Le mar. 22 oct. 2019 ?? 10:21, Tobias Pape <[hidden email]> a ??crit :
>
> >
> > > On 22.10.2019, at 10:17, Fabio Niephaus <[hidden email]> wrote:
> > >
> > > Considering there's quite some code relying on `Smalltalk platformName =
> > 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might
> > want to clean this up, but it will be hard to provide backward
> > compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])
> > >
> >
> > Win32 is the correct name, irrespective of 64/32 bit executables.
> >
> > Best regards
> >         -Tobias
> >
> > > Fabio
> > >
> > > [1]
> > https://github.com/hpi-swa/graalsqueak/blob/9ce025f5f891a6369881551897e39a604cd6e617/src/de.hpi.swa.graal.squeak/src/de/hpi/swa/graal/squeak/util/OSDetector.java#L37
> > >
> > > On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <
> > [hidden email]> wrote:
> > > I dunno, my Squeak download says its 64 bit, but Smalltalk platformName
> > answers Win32 still; isn???t the 64 bit exe still experimental?
> > >
> > > /????????????????????????????????????????????????????????????/
> > > For encrypted mail use [hidden email]
> > > Get a free account at ProtonMail.com
> > > Web: www.objectnets.net and www.objectnets.org
> > >
> > >> On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:
> > >>
> > >> ???
> > >> I was trying to find out all possible values of this message.  Browsing
> > senders reveals a need to factor this out into a first-class SqueakPlatform
> > -- we have way too many places which employ switch statements to determine
> > what to do:
> > >>
> > >>     Smalltalk platformName = "Mac OS"
> > >>        ifTrue:
> > >>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir |
> > aBlock value: fontDir]. ]
> > >>
> > >> Others check for "Win32", I'm not sure what #platformName is answering
> > on 64-bit VM on Windows these days, could someone running Windows please
> > tell me?
> > >>
> > >> Still others check for "Risc OS" or "unix".  So, the full list I have
> > so far is:
> > >>
> > >>     unix
> > >>     Win32
> > >>     Mac OS
> > >>     Risc OS
> > >>
> > >> If you know of any others, please let me know.
> > >>
> > >>  - Chris
> > >>
> > >
> > >
> >
> >
> >
> >

>


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

Bert Freudenberg
In reply to this post by Chris Muller-4
Smalltalk platformName
=> 'Web'
Smalltalk vmVersion
=> 'SqueakJS 0.9.7'

- Bert -

On Mon, Oct 21, 2019 at 6:10 PM Chris Muller <[hidden email]> wrote:
I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:

    Smalltalk platformName = "Mac OS" 
       ifTrue: 
          [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]

Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?

Still others check for "Risc OS" or "unix".  So, the full list I have so far is:

    unix
    Win32
    Mac OS
    Risc OS

If you know of any others, please let me know.

 - Chris



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

marcel.taeumel
In reply to this post by Nicolas Cellier
Sounds good for a name. 

+1 for OSPlatform
-1 for SqueakPlatform

Best,
Marcel

Am 22.10.2019 11:07:13 schrieb Nicolas Cellier <[hidden email]>:

Please consider if the work done in Pharo OSPlatform may fit.
Otherwise, maintaining multi-dialect compatibility becomes harder than necessary.


Le mar. 22 oct. 2019 à 10:21, Tobias Pape <[hidden email]> a écrit :

> On 22.10.2019, at 10:17, Fabio Niephaus <[hidden email]> wrote:
>
> Considering there's quite some code relying on `Smalltalk platformName = 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might want to clean this up, but it will be hard to provide backward compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])
>

Win32 is the correct name, irrespective of 64/32 bit executables.

Best regards
        -Tobias

> Fabio
>
> [1] https://github.com/hpi-swa/graalsqueak/blob/9ce025f5f891a6369881551897e39a604cd6e617/src/de.hpi.swa.graal.squeak/src/de/hpi/swa/graal/squeak/util/OSDetector.java#L37
>
> On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <[hidden email]> wrote:
> I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?
>
> /————————————————————/
> For encrypted mail use [hidden email]
> Get a free account at ProtonMail.com
> Web: www.objectnets.net and www.objectnets.org
>
>> On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:
>>
>> 
>> I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:
>>
>>     Smalltalk platformName = "Mac OS"
>>        ifTrue:
>>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]
>>
>> Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?
>>
>> Still others check for "Risc OS" or "unix".  So, the full list I have so far is:
>>
>>     unix
>>     Win32
>>     Mac OS
>>     Risc OS
>>
>> If you know of any others, please let me know.
>>
>>  - Chris
>>
>
>





Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk>>#platformName

Chris Muller-3
Just for clarity, I'm not "tackling" this right now, just needed all the possible values for a SUnit test case I'm writing.  I got "Web" added too, thanks, appreciate all the feedback!

If / when we do, I agree OSPlatform.   :)

On Wed, Oct 23, 2019 at 8:45 AM Marcel Taeumel <[hidden email]> wrote:
Sounds good for a name. 

+1 for OSPlatform
-1 for SqueakPlatform

Best,
Marcel

Am 22.10.2019 11:07:13 schrieb Nicolas Cellier <[hidden email]>:

Please consider if the work done in Pharo OSPlatform may fit.
Otherwise, maintaining multi-dialect compatibility becomes harder than necessary.


Le mar. 22 oct. 2019 à 10:21, Tobias Pape <[hidden email]> a écrit :

> On 22.10.2019, at 10:17, Fabio Niephaus <[hidden email]> wrote:
>
> Considering there's quite some code relying on `Smalltalk platformName = 'Win32'`, I'm certain the Windows 64bit VM also returns `Win32`. We might want to clean this up, but it will be hard to provide backward compatibility. In 64bit GraalSqueak, we also return 'Win32' (see [1])
>

Win32 is the correct name, irrespective of 64/32 bit executables.

Best regards
        -Tobias

> Fabio
>
> [1] https://github.com/hpi-swa/graalsqueak/blob/9ce025f5f891a6369881551897e39a604cd6e617/src/de.hpi.swa.graal.squeak/src/de/hpi/swa/graal/squeak/util/OSDetector.java#L37
>
> On Tue, Oct 22, 2019 at 10:18 AM John Pfersich via Squeak-dev <[hidden email]> wrote:
> I dunno, my Squeak download says its 64 bit, but Smalltalk platformName answers Win32 still; isn’t the 64 bit exe still experimental?
>
> /————————————————————/
> For encrypted mail use [hidden email]
> Get a free account at ProtonMail.com
> Web: www.objectnets.net and www.objectnets.org
>
>> On Oct 21, 2019, at 18:10, Chris Muller <[hidden email]> wrote:
>>
>> 
>> I was trying to find out all possible values of this message.  Browsing senders reveals a need to factor this out into a first-class SqueakPlatform -- we have way too many places which employ switch statements to determine what to do:
>>
>>     Smalltalk platformName = "Mac OS"
>>        ifTrue:
>>           [ #('/System/Library/Fonts' '/Library/Fonts') do: [:fontDir | aBlock value: fontDir]. ]
>>
>> Others check for "Win32", I'm not sure what #platformName is answering on 64-bit VM on Windows these days, could someone running Windows please tell me?
>>
>> Still others check for "Risc OS" or "unix".  So, the full list I have so far is:
>>
>>     unix
>>     Win32
>>     Mac OS
>>     Risc OS
>>
>> If you know of any others, please let me know.
>>
>>  - Chris
>>
>
>