printOnStream:

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

printOnStream:

Eliot Miranda-2
Hi All,

    is printOnStream: useful?  Anyone know what it was for?  It looks
wrong to me.  It prints strings rather than objects.  e.g. thisContext
method printOn: Transcript writes
        'a CompiledMethod'
to Transcript, rather than
        a CompiledMethod
Further some of the method stamps are 1901.

The Pharo guys have nuked this.  Looks like it might be a good idea.
--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

Nicolas Cellier
Nuking any piece of Squeak code with the word 'Stream' in it might be
a good idea anyway ;)
Seriously, I never dared, because it's one of the few senders of
#byteEncode: along with #encodePostscriptOn:...
But looking at the code, it seems to be a very generic visitor
pattern, and not really used directly by PostscriptEncoder, but by
parallel PrintEncoder and StoreEncoder...
It seems to just be a proof of concept for replacing printOn:/storeOn:
Such a proof of concept with no comment, no use case, and loosy
implementation might well go out of the image, I won't cry...

Nicolas

2013/2/24 Eliot Miranda <[hidden email]>:

> Hi All,
>
>     is printOnStream: useful?  Anyone know what it was for?  It looks
> wrong to me.  It prints strings rather than objects.  e.g. thisContext
> method printOn: Transcript writes
>         'a CompiledMethod'
> to Transcript, rather than
>         a CompiledMethod
> Further some of the method stamps are 1901.
>
> The Pharo guys have nuked this.  Looks like it might be a good idea.
> --
> best,
> Eliot
>

Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

David T. Lewis
In reply to this post by Eliot Miranda-2
On Sun, Feb 24, 2013 at 02:12:58PM -0800, Eliot Miranda wrote:

> Hi All,
>
>     is printOnStream: useful?  Anyone know what it was for?  It looks
> wrong to me.  It prints strings rather than objects.  e.g. thisContext
> method printOn: Transcript writes
>         'a CompiledMethod'
> to Transcript, rather than
>         a CompiledMethod
> Further some of the method stamps are 1901.
>
> The Pharo guys have nuked this.  Looks like it might be a good idea.
> --
> best,
> Eliot

These methods are apparently by Marcel Weiher (MPW) and are probably related
to Postscript encoding, see MorphicExtras-Postscript Filters.

None of this (including the Postscript encoding) is used in Squeak now, and
I don't see any usage as far back as Squeak 3.6 either.

Maybe someone can remember what this was used for? Otherwise, I can't see
anything wrong with removing all implementers of #printOnStream: as well as
the entire category "MorphicExtras-Postscript Filters" and the test method
IntegerTest>>testIntegerByteEncoded.

(cc to a possibly valid email address for Marcel)

Dave


Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

Marcel Weiher-3
Sounds about right.  Has PS/PDF/printed output been removed completely or is there an alternative?

On Feb 25, 2013, at 0:57 , David T. Lewis <[hidden email]> wrote:

>
> These methods are apparently by Marcel Weiher (MPW) and are probably related
> to Postscript encoding, see MorphicExtras-Postscript Filters.
>
> None of this (including the Postscript encoding) is used in Squeak now, and
> I don't see any usage as far back as Squeak 3.6 either.
>
> Maybe someone can remember what this was used for? Otherwise, I can't see
> anything wrong with removing all implementers of #printOnStream: as well as
> the entire category "MorphicExtras-Postscript Filters" and the test method
> IntegerTest>>testIntegerByteEncoded.


Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

David T. Lewis
Hi Marcel,

On Mon, Feb 25, 2013 at 11:25:37AM +0100, Marcel Weiher wrote:
> Sounds about right.  Has PS/PDF/printed output been removed completely or is there an alternative?
>

Postscript printing is supported. Any morph can be saved to Postscript or
EPS file for printing. I don't know much about this topic, but the classes
supporting Postscript output are in category 'MorphicExtras-Postscript Canvases',
and they don't appear to have any connection with the encoder classes in
'MorphicExtras-Postscript Filters'.

Are there any external packages outside of the Squeak image itself that
make use of these encoders and expect them to be in the image?

Thanks!
Dave

> On Feb 25, 2013, at 0:57 , David T. Lewis <[hidden email]> wrote:
> >
> > These methods are apparently by Marcel Weiher (MPW) and are probably related
> > to Postscript encoding, see MorphicExtras-Postscript Filters.
> >
> > None of this (including the Postscript encoding) is used in Squeak now, and
> > I don't see any usage as far back as Squeak 3.6 either.
> >
> > Maybe someone can remember what this was used for? Otherwise, I can't see
> > anything wrong with removing all implementers of #printOnStream: as well as
> > the entire category "MorphicExtras-Postscript Filters" and the test method
> > IntegerTest>>testIntegerByteEncoded.
>

Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

Marcel Weiher-3
Hi David,

On Feb 25, 2013, at 15:06 , David T. Lewis <[hidden email]> wrote:
> On Mon, Feb 25, 2013 at 11:25:37AM +0100, Marcel Weiher wrote:
>> On Feb 25, 2013, at 0:57 , David T. Lewis <[hidden email]> wrote:
>>> [..]
>>> None of this (including the Postscript encoding) is used in Squeak now, and
>>> I don't see any usage as far back as Squeak 3.6 either.

>> Sounds about right.  Has PS/PDF/printed output been removed completely or is there an alternative?
>
> Postscript printing is supported. Any morph can be saved to Postscript or
> EPS file for printing

OK, I was confused for a bit, but as far as I can tell the Postscript support that is in 4.3 is still the one I implemented way back when, which includes the PostscriptEncoder and that's a subclass of ByteEncoder (Via PrintableEncoder).   FlattenEncoder -> ByteEncoder -> PostscriptEncoder -> PostscriptEncoderToDisk, and the Postscript Encoders are used by the Postscript Canvas.     ByteEncoder is in  "MorphicExtras-Postscript Filters", so if you nuke that entire category, you would appear to also nuke Postscript support.

Speaking of which, I remember having to hack quite a bit of nasty code because text was actually not going through the canvas but implemented back in BitBlit, which then forwarded a bitmap to the Canvas.  Has that been fixed?

Cheers,

Marcel


Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

David T. Lewis
On Mon, Feb 25, 2013 at 06:30:54PM +0100, Marcel Weiher wrote:

> Hi David,
>
> On Feb 25, 2013, at 15:06 , David T. Lewis <[hidden email]> wrote:
> > On Mon, Feb 25, 2013 at 11:25:37AM +0100, Marcel Weiher wrote:
> >> On Feb 25, 2013, at 0:57 , David T. Lewis <[hidden email]> wrote:
> >>> [..]
> >>> None of this (including the Postscript encoding) is used in Squeak now, and
> >>> I don't see any usage as far back as Squeak 3.6 either.
>
> >> Sounds about right.  Has PS/PDF/printed output been removed completely or is there an alternative?
> >
> > Postscript printing is supported. Any morph can be saved to Postscript or
> > EPS file for printing
>
> OK, I was confused for a bit, but as far as I can tell the Postscript support that is in 4.3 is still the one I implemented way back when, which includes the PostscriptEncoder and that's a subclass of ByteEncoder (Via PrintableEncoder).   FlattenEncoder -> ByteEncoder -> PostscriptEncoder -> PostscriptEncoderToDisk, and the Postscript Encoders are used by the Postscript Canvas.     ByteEncoder is in  "MorphicExtras-Postscript Filters", so if you nuke that entire category, you would appear to also nuke Postscript support.
>

D'oh! Yes of course you are right. I overlooked that PrintableEncoder
has subclasses. Thank you.

So there may be some unreferenced classes and methods, but "MorphicExtras-Postscript Filters"
definitely is required.


> Speaking of which, I remember having to hack quite a bit of nasty code because text was actually not going through the canvas but implemented back in BitBlit, which then forwarded a bitmap to the Canvas.  Has that been fixed?
>

I really don't know. Maybe someone else can answer?

Thanks,
Dave

> Cheers,
>
> Marcel
>

Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

Nicolas Cellier
2013/2/25 David T. Lewis <[hidden email]>:

> On Mon, Feb 25, 2013 at 06:30:54PM +0100, Marcel Weiher wrote:
>> Hi David,
>>
>> On Feb 25, 2013, at 15:06 , David T. Lewis <[hidden email]> wrote:
>> > On Mon, Feb 25, 2013 at 11:25:37AM +0100, Marcel Weiher wrote:
>> >> On Feb 25, 2013, at 0:57 , David T. Lewis <[hidden email]> wrote:
>> >>> [..]
>> >>> None of this (including the Postscript encoding) is used in Squeak now, and
>> >>> I don't see any usage as far back as Squeak 3.6 either.
>>
>> >> Sounds about right.  Has PS/PDF/printed output been removed completely or is there an alternative?
>> >
>> > Postscript printing is supported. Any morph can be saved to Postscript or
>> > EPS file for printing
>>
>> OK, I was confused for a bit, but as far as I can tell the Postscript support that is in 4.3 is still the one I implemented way back when, which includes the PostscriptEncoder and that's a subclass of ByteEncoder (Via PrintableEncoder).   FlattenEncoder -> ByteEncoder -> PostscriptEncoder -> PostscriptEncoderToDisk, and the Postscript Encoders are used by the Postscript Canvas.     ByteEncoder is in  "MorphicExtras-Postscript Filters", so if you nuke that entire category, you would appear to also nuke Postscript support.
>>
>
> D'oh! Yes of course you are right. I overlooked that PrintableEncoder
> has subclasses. Thank you.
>
> So there may be some unreferenced classes and methods, but "MorphicExtras-Postscript Filters"
> definitely is required.
>

Great, that confirms my own analyze.
But the parallel hierarchy PrintEncoder StoreEncoder and
PropertyListEncoder are presumably not used, and were just experiments
right?

If yes, we should remove the printOnStream: storeOnStream:, and can't
remember last filterMethod (propertyListOn: ?)

>
>> Speaking of which, I remember having to hack quite a bit of nasty code because text was actually not going through the canvas but implemented back in BitBlit, which then forwarded a bitmap to the Canvas.  Has that been fixed?
>>
>
> I really don't know. Maybe someone else can answer?
>

In a better world, the answer should be given by some SUnit TestCase...

Nicolas

> Thanks,
> Dave
>
>> Cheers,
>>
>> Marcel
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: printOnStream:

Marcel Weiher-3

On Feb 25, 2013, at 20:22 , Nicolas Cellier <[hidden email]> wrote:
>
> Great, that confirms my own analyze.
> But the parallel hierarchy PrintEncoder StoreEncoder and
> PropertyListEncoder are presumably not used, and were just experiments
> right?

Pretty sure, yes.

> If yes, we should remove the printOnStream: storeOnStream:, and can't
> remember last filterMethod (propertyListOn: ?)

Sounds about right.

Cheers,

Marcel