[VW7.5] [Bug] CommandLineInterest>>printOn:

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

[VW7.5] [Bug] CommandLineInterest>>printOn:

Stew MacLean

Hi,

 

This method sends super, resulting in a confusing printString.

 

Fix

 

printOn: aStream

 

            “Override to not send super, to avoid double printing, and copy down Object>>printOn: to print the class.

08/06/07 SIM”

 

 

| title |

        title := self class printString.

        aStream nextPutAll:

                ((title at: 1) isVowel ifTrue: ['an '] ifFalse: ['a ']).

        aStream nextPutAll: title.

 

super printOn: aStream.”

 

            aStream

                        nextPutAll: '(on: ';

                        print: systemEvent;

                        nextPutAll: ' at: ';

                        print: sequence;

                        nextPutAll: ' for: ';

                        print: option;

                        nextPutAll: ' send: ''';

                        print: receiver;

                        space;

                        nextPutAll: selector;

                        nextPutAll: ''')'.

 

Do I get a T-Shirt? J

 

This is when a super super would be useful?

Reply | Threaded
Open this post in threaded view
|

Re: [VW7.5] [Bug] CommandLineInterest>>printOn:

Eliot Miranda-2
Stewart,

    Object>>basicPrintOn: is provided for precisely this.  So the right fix IMO is

printOn: aStream
    self basicPrintOn: aStream.
    aStream
        nextPutAll: '(on: ';
        print: systemEvent;
        nextPutAll: ' at: ';
        print: sequence;
        nextPutAll: ' for: ';
        print: option;
        nextPutAll: ' send: ''';
        print: receiver;
        space;
        nextPutAll: selector;
        nextPutAll: ''')'.

What size is your teeshirt? ;)

BTW, Dan Ingalls' and Alan Borning's multiple inheritance system provided

    self Object.printOn: aStream

to solve the super super issue.  I prefer self.Object printOn: aStream.  But periods in selectors are no longer allowed :(

On 6/7/07, Stewart MacLean <[hidden email]> wrote:

Hi,

 

This method sends super, resulting in a confusing printString.

 

Fix

 

printOn: aStream

 

            "Override to not send super, to avoid double printing, and copy down Object>>printOn: to print the class.

08/06/07 SIM"

 

 

| title |

        title := self class printString.

        aStream nextPutAll:

                ((title at: 1) isVowel ifTrue: ['an '] ifFalse: ['a ']).

        aStream nextPutAll: title.

 

"super printOn: aStream."

 

            aStream

                        nextPutAll: '(on: ';

                        print: systemEvent;

                        nextPutAll: ' at: ';

                        print: sequence;

                        nextPutAll: ' for: ';

                        print: option;

                        nextPutAll: ' send: ''';

                        print: receiver;

                        space;

                        nextPutAll: selector;

                        nextPutAll: ''')'.

 

Do I get a T-Shirt? J

 

This is when a super super would be useful?


Reply | Threaded
Open this post in threaded view
|

RE: [VW7.5] [Bug] CommandLineInterest>>printOn:

Stew MacLean

Hi Eliot,

 

On that basis, should Object>>printOn: aStream

 

 

Not be

 

Object>>printOn: aStream

      "Append to the argument aStream a sequence of characters

        that describes the receiver."

 

            self basicPrintOn: aStream

 

 

?

 

Bear in mind it is 6am here, and I’m still trying to package for Mac OS X…

 

-----Original Message-----
From: Eliot Miranda [mailto:[hidden email]]
Sent: 8 June 2007 5:57 a.m.
To: Stewart MacLean
Cc: vwnc
Subject: Re: [VW7.5] [Bug] CommandLineInterest>>printOn:

 

Stewart,

    Object>>basicPrintOn: is provided for precisely this.  So the right fix IMO is

printOn: aStream
    self basicPrintOn: aStream.
    aStream
        nextPutAll: '(on: ';
        print: systemEvent;
        nextPutAll: ' at: ';
        print: sequence;
        nextPutAll: ' for: ';
        print: option;
        nextPutAll: ' send: ''';
        print: receiver;
        space;
        nextPutAll: selector;
        nextPutAll: ''')'.

What size is your teeshirt? ;)

BTW, Dan Ingalls' and Alan Borning's multiple inheritance system provided

    self Object.printOn: aStream

to solve the super super issue.  I prefer self.Object printOn: aStream.  But periods in selectors are no longer allowed :(

On 6/7/07, Stewart MacLean <[hidden email]> wrote:

Hi,

 

This method sends super, resulting in a confusing printString.

 

Fix

 

printOn: aStream

 

            "Override to not send super, to avoid double printing, and copy down Object>>printOn: to print the class.

08/06/07 SIM"

 

 

| title |

        title := self class printString.

        aStream nextPutAll:

                ((title at: 1) isVowel ifTrue: ['an '] ifFalse: ['a ']).

        aStream nextPutAll: title.

 

"super printOn: aStream."

 

            aStream

                        nextPutAll: '(on: ';

                        print: systemEvent;

                        nextPutAll: ' at: ';

                        print: sequence;

                        nextPutAll: ' for: ';

                        print: option;

                        nextPutAll: ' send: ''';

                        print: receiver;

                        space;

                        nextPutAll: selector;

                        nextPutAll: ''')'.

 

Do I get a T-Shirt? J

 

This is when a super super would be useful?

 

Reply | Threaded
Open this post in threaded view
|

Re: [VW7.5] [Bug] CommandLineInterest>>printOn:

Eliot Miranda-2
If only you were in Hawaii, I'd plead for a job ;)

Re Object>>printOn: you can argue either way.  e.g. if it ain't broke don't fix it; printOn: predates basicPrintOn:...

cheers!

On 6/7/07, Stewart MacLean <[hidden email]> wrote:

Hi Eliot,

 

On that basis, should Object>>printOn: aStream

 

 

Not be

 

Object>>printOn: aStream

      "Append to the argument aStream a sequence of characters

        that describes the receiver."

 

            self basicPrintOn: aStream

 

 

?

 

Bear in mind it is 6am here, and I'm still trying to package for Mac OS X…

 

-----Original Message-----
From: Eliot Miranda [mailto:[hidden email]]
Sent: 8 June 2007 5:57 a.m.
To: Stewart MacLean
Cc: vwnc
Subject: Re: [VW7.5] [Bug] CommandLineInterest>>printOn:

 

Stewart,

    Object>>basicPrintOn: is provided for precisely this.  So the right fix IMO is

printOn: aStream
    self basicPrintOn: aStream.
    aStream
        nextPutAll: '(on: ';
        print: systemEvent;
        nextPutAll: ' at: ';
        print: sequence;
        nextPutAll: ' for: ';
        print: option;
        nextPutAll: ' send: ''';
        print: receiver;
        space;
        nextPutAll: selector;
        nextPutAll: ''')'.

What size is your teeshirt? ;)

BTW, Dan Ingalls' and Alan Borning's multiple inheritance system provided

    self Object.printOn: aStream

to solve the super super issue.  I prefer self.Object printOn: aStream.  But periods in selectors are no longer allowed :(

On 6/7/07, Stewart MacLean <[hidden email]> wrote:

Hi,

 

This method sends super, resulting in a confusing printString.

 

Fix

 

printOn: aStream

 

            "Override to not send super, to avoid double printing, and copy down Object>>printOn: to print the class.

08/06/07 SIM"

 

 

| title |

        title := self class printString.

        aStream nextPutAll:

                ((title at: 1) isVowel ifTrue: ['an '] ifFalse: ['a ']).

        aStream nextPutAll: title.

 

"super printOn: aStream."

 

            aStream

                        nextPutAll: '(on: ';

                        print: systemEvent;

                        nextPutAll: ' at: ';

                        print: sequence;

                        nextPutAll: ' for: ';

                        print: option;

                        nextPutAll: ' send: ''';

                        print: receiver;

                        space;

                        nextPutAll: selector;

                        nextPutAll: ''')'.

 

Do I get a T-Shirt? J

 

This is when a super super would be useful?