Some references to transcript should be changed into File stdout

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

Some references to transcript should be changed into File stdout

stepharo
Hi

I have the impression that some references to Transcript should be
rewritten as File stdout

For example

DummyUIManager>>unhandledErrorDefaultAction: anException

     Transcript show: '*** EXCEPTION ***'; cr.
     Transcript show: anException; cr.
     Transcript show: (thisContext stack first: (20 min: thisContext
stack size)); cr.
     anException isResumable ifTrue: [ anException resume ]

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

philippeback
NonInteractiveTranscript is usually the class then, so no need to File stdout anything I guess.

NonInteractiveTranscript install is "de rigueur" for CLI style apps.

Phil

On Wed, Sep 23, 2015 at 1:16 PM, stepharo <[hidden email]> wrote:
Hi

I have the impression that some references to Transcript should be rewritten as File stdout

For example

DummyUIManager>>unhandledErrorDefaultAction: anException

    Transcript show: '*** EXCEPTION ***'; cr.
    Transcript show: anException; cr.
    Transcript show: (thisContext stack first: (20 min: thisContext stack size)); cr.
    anException isResumable ifTrue: [ anException resume ]

Stef


Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

Eliot Miranda-2
In reply to this post by stepharo
Hi Stef,

    Transcript in Smalltalk-80 systems and in Squeak and earlier Pharo versions is a variable.  So when the system is running headless or on the command line Transcript can be assigned something that writes to stdout (eg an instance of NonInteractiveTranscript).  This is nice and simple.  Eliminating the variable and replacing it by a class might be a mistake because it obscures the idea that Transcript may be different in different system states.

_,,,^..^,,,_ (phone)

> On Sep 23, 2015, at 4:16 AM, stepharo <[hidden email]> wrote:
>
> Hi
>
> I have the impression that some references to Transcript should be rewritten as File stdout
>
> For example
>
> DummyUIManager>>unhandledErrorDefaultAction: anException
>
>    Transcript show: '*** EXCEPTION ***'; cr.
>    Transcript show: anException; cr.
>    Transcript show: (thisContext stack first: (20 min: thisContext stack size)); cr.
>    anException isResumable ifTrue: [ anException resume ]
>
> Stef
>

Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

Sven Van Caekenberghe-2

> On 24 Sep 2015, at 15:38, Eliot Miranda <[hidden email]> wrote:
>
> Hi Stef,
>
>    Transcript in Smalltalk-80 systems and in Squeak and earlier Pharo versions is a variable.  So when the system is running headless or on the command line Transcript can be assigned something that writes to stdout (eg an instance of NonInteractiveTranscript).  This is nice and simple.  Eliminating the variable and replacing it by a class might be a mistake because it obscures the idea that Transcript may be different in different system states.

Exactly, and that is what we have with NonInteractiveTranscript (and in Pharo 5, DailyNonInteractiveTranscript and TTranscript).

> _,,,^..^,,,_ (phone)
>
>> On Sep 23, 2015, at 4:16 AM, stepharo <[hidden email]> wrote:
>>
>> Hi
>>
>> I have the impression that some references to Transcript should be rewritten as File stdout
>>
>> For example
>>
>> DummyUIManager>>unhandledErrorDefaultAction: anException
>>
>>   Transcript show: '*** EXCEPTION ***'; cr.
>>   Transcript show: anException; cr.
>>   Transcript show: (thisContext stack first: (20 min: thisContext stack size)); cr.
>>   anException isResumable ifTrue: [ anException resume ]
>>
>> Stef
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

stepharo
In reply to this post by stepharo
Guys

may be you do not understand or I'm too stupid.
My point is what are the preconditions (tools loaded in the system) that
DummyUIManager should have.
I thought that DummyUIManager (which should not be morphic else I do not
understand what is
MorphicUIManager) was for a system without a Morphic UI. So how it is
possible that a system without
UI could report error using a UI tool?

Stef

Le 23/9/15 11:16, stepharo a écrit :

> Hi
>
> I have the impression that some references to Transcript should be
> rewritten as File stdout
>
> For example
>
> DummyUIManager>>unhandledErrorDefaultAction: anException
>
>     Transcript show: '*** EXCEPTION ***'; cr.
>     Transcript show: anException; cr.
>     Transcript show: (thisContext stack first: (20 min: thisContext
> stack size)); cr.
>     anException isResumable ifTrue: [ anException resume ]
>
> Stef
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

stepharo
Was teaching 8 hours per day this week and dead.
Ok I read the other answers.
I do not like this ide of global variable.


Le 24/9/15 18:45, stepharo a écrit :

> Guys
>
> may be you do not understand or I'm too stupid.
> My point is what are the preconditions (tools loaded in the system)
> that DummyUIManager should have.
> I thought that DummyUIManager (which should not be morphic else I do
> not understand what is
> MorphicUIManager) was for a system without a Morphic UI. So how it is
> possible that a system without
> UI could report error using a UI tool?
>
> Stef
>
> Le 23/9/15 11:16, stepharo a écrit :
>> Hi
>>
>> I have the impression that some references to Transcript should be
>> rewritten as File stdout
>>
>> For example
>>
>> DummyUIManager>>unhandledErrorDefaultAction: anException
>>
>>     Transcript show: '*** EXCEPTION ***'; cr.
>>     Transcript show: anException; cr.
>>     Transcript show: (thisContext stack first: (20 min: thisContext
>> stack size)); cr.
>>     anException isResumable ifTrue: [ anException resume ]
>>
>> Stef
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Some references to transcript should be changed into File stdout

Eliot Miranda-2
In reply to this post by stepharo
Hu Stef,

On Thu, Sep 24, 2015 at 11:45 AM, stepharo <[hidden email]> wrote:
Guys

may be you do not understand or I'm too stupid.
My point is what are the preconditions (tools loaded in the system) that DummyUIManager should have.
I thought that DummyUIManager (which should not be morphic else I do not understand what is
MorphicUIManager) was for a system without a Morphic UI. So how it is possible that a system without
UI could report error using a UI tool?

1. The object referred to by the Transcript variable *is not necessarily* a UI tool.  It may be headless and have no UI component; it may send output ti stdout or a file or... There is no assumption in DummyUIManager's use that Transcript is a UI component.

2. In testing DummyUIManager it may indeed be useful to have DummyUIManager output to a GUI transcript window.


HTH



Stef

Le 23/9/15 11:16, stepharo a écrit :

Hi

I have the impression that some references to Transcript should be rewritten as File stdout

For example

DummyUIManager>>unhandledErrorDefaultAction: anException

    Transcript show: '*** EXCEPTION ***'; cr.
    Transcript show: anException; cr.
    Transcript show: (thisContext stack first: (20 min: thisContext stack size)); cr.
    anException isResumable ifTrue: [ anException resume ]

Stef







--
_,,,^..^,,,_
best, Eliot