XMLWriter does not load in development in Pharo

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

XMLWriter does not load in development in Pharo

CyrilFerlicot
Hi,

There was a commit in XMLWriter using `Smalltalk plateformName
asLowercase beginsWith: 'win'` in the initialisation of the writer
class. #plateformName does not exist in the Pharo image so it's
impossible to load the development version of  XMLWriter in Pharo at the
moment.

Instead I think it should use `OSPlatform current isWindows`. Or even
better: `OSPlatform current lineEnding`. Since I don't know if XMLWriter
is a Pharo project or if it's loadable in other Smalltalk I prefer to
send a mail instead of changing the code myself.

--
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: XMLWriter does not load in development in Pharo

Henrik Sperre Johansen
If the goal is x-platform, the magic incantation that works in both Pharo and Squeak, is
Smalltalk os platformName.

Cheers,
Henry

> On 05 Jul 2016, at 10:41 , Cyril Ferlicot Delbecque <[hidden email]> wrote:
>
> Hi,
>
> There was a commit in XMLWriter using `Smalltalk plateformName
> asLowercase beginsWith: 'win'` in the initialisation of the writer
> class. #plateformName does not exist in the Pharo image so it's
> impossible to load the development version of  XMLWriter in Pharo at the
> moment.
>
> Instead I think it should use `OSPlatform current isWindows`. Or even
> better: `OSPlatform current lineEnding`. Since I don't know if XMLWriter
> is a Pharo project or if it's loadable in other Smalltalk I prefer to
> send a mail instead of changing the code myself.
>
> --
> Cyril Ferlicot
>
> http://www.synectique.eu
>
> 165 Avenue Bretagne
> Lille 59000 France
>


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: XMLWriter does not load in development in Pharo

monty-3
In reply to this post by CyrilFerlicot
It's strange because "Smalltalk platformName" (the typo "plateform" is only in your post, not the source method) worked fine in my personal 5.0 image and for both stable and development 5.0 CI builds, but failed for development but not stable 3.0 and 4.0 builds.

There is a new release which fixes the issue, but it is a bit more complex than using OSPlatform because XMLWriter and all XMLParser related libs target all Pharo versions back to 1.4 and recent Squeak/GemStone(gsDevKit) releases, so assuming OSPlatform is present is a non-starter.

Thanks for the report.

> Sent: Tuesday, July 05, 2016 at 4:41 AM
> From: "Cyril Ferlicot Delbecque" <[hidden email]>
> To: "Pharo Development List" <[hidden email]>, monty <[hidden email]>
> Subject: XMLWriter does not load in development in Pharo
>
> Hi,
>
> There was a commit in XMLWriter using `Smalltalk plateformName
> asLowercase beginsWith: 'win'` in the initialisation of the writer
> class. #plateformName does not exist in the Pharo image so it's
> impossible to load the development version of  XMLWriter in Pharo at the
> moment.
>
> Instead I think it should use `OSPlatform current isWindows`. Or even
> better: `OSPlatform current lineEnding`. Since I don't know if XMLWriter
> is a Pharo project or if it's loadable in other Smalltalk I prefer to
> send a mail instead of changing the code myself.
>
> --
> Cyril Ferlicot
>
> http://www.synectique.eu
>
> 165 Avenue Bretagne
> Lille 59000 France
>
>

Reply | Threaded
Open this post in threaded view
|

Re: XMLWriter does not load in development in Pharo

monty-3
In reply to this post by Henrik Sperre Johansen
This would be cleaner than my current fix, so I'll try it, thanks.

> Sent: Tuesday, July 05, 2016 at 6:12 AM
> From: "Henrik Johansen" <[hidden email]>
> To: "Pharo Development List" <[hidden email]>
> Subject: Re: [Pharo-dev] XMLWriter does not load in development in Pharo
>
> If the goal is x-platform, the magic incantation that works in both Pharo and Squeak, is
> Smalltalk os platformName.
>
> Cheers,
> Henry
> > On 05 Jul 2016, at 10:41 , Cyril Ferlicot Delbecque <[hidden email]> wrote:
> >
> > Hi,
> >
> > There was a commit in XMLWriter using `Smalltalk plateformName
> > asLowercase beginsWith: 'win'` in the initialisation of the writer
> > class. #plateformName does not exist in the Pharo image so it's
> > impossible to load the development version of  XMLWriter in Pharo at the
> > moment.
> >
> > Instead I think it should use `OSPlatform current isWindows`. Or even
> > better: `OSPlatform current lineEnding`. Since I don't know if XMLWriter
> > is a Pharo project or if it's loadable in other Smalltalk I prefer to
> > send a mail instead of changing the code myself.
> >
> > --
> > Cyril Ferlicot
> >
> > http://www.synectique.eu
> >
> > 165 Avenue Bretagne
> > Lille 59000 France
> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: XMLWriter does not load in development in Pharo

Henrik Sperre Johansen
I can't find the thread, but the entire protocol used to al on SmalltalkImage, which grew sort of unwieldy.
Then, some time before 1.4, Pharo split off the functionality to separate classes (OSPlatform etc.),

Sometime before the release of Pharo 1.4/ squeak 4.0, it was agreed that adding os / vm etc. accessors to SmalltalkImage (aka the Smalltalk global)  would be a good delegation layer that allowed for writing the same code to work on both, without requiring the actual split into separate classes as Pharo did.
I *think* it's all still in one place in Squeak, in Pharo, most of the original protocol now resides in the "compatability" protocol IIRC (after all, it *is* a bit nicer to write Smalltalk os/platform name).

Anyways, the outcome is that in general, using
Smalltalk xx yyy
constructs should be what yields the widest support for the lowest amount of effort.

Cheers,
Henry


> On 05 Jul 2016, at 1:17 , monty <[hidden email]> wrote:
>
> This would be cleaner than my current fix, so I'll try it, thanks.
>
>> Sent: Tuesday, July 05, 2016 at 6:12 AM
>> From: "Henrik Johansen" <[hidden email]>
>> To: "Pharo Development List" <[hidden email]>
>> Subject: Re: [Pharo-dev] XMLWriter does not load in development in Pharo
>>
>> If the goal is x-platform, the magic incantation that works in both Pharo and Squeak, is
>> Smalltalk os platformName.
>>
>> Cheers,
>> Henry
>>> On 05 Jul 2016, at 10:41 , Cyril Ferlicot Delbecque <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> There was a commit in XMLWriter using `Smalltalk plateformName
>>> asLowercase beginsWith: 'win'` in the initialisation of the writer
>>> class. #plateformName does not exist in the Pharo image so it's
>>> impossible to load the development version of  XMLWriter in Pharo at the
>>> moment.
>>>
>>> Instead I think it should use `OSPlatform current isWindows`. Or even
>>> better: `OSPlatform current lineEnding`. Since I don't know if XMLWriter
>>> is a Pharo project or if it's loadable in other Smalltalk I prefer to
>>> send a mail instead of changing the code myself.
>>>
>>> --
>>> Cyril Ferlicot
>>>
>>> http://www.synectique.eu
>>>
>>> 165 Avenue Bretagne
>>> Lille 59000 France
>>>
>>
>>
>


signature.asc (859 bytes) Download Attachment