Re: Transcript cf printNl

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

Re: Transcript cf printNl

Paolo Bonzini-2
Stephen Woolerton wrote:
> Hi Paolo,
>
> This may help, In a script...
>
> 5 class prinNl. "succeeds"
> Transcript show: (5 class)  "crashes"
>
> Same thing if I substitute 'inspect' instead of 'class'. It works with
> printNl and crashes if going through Transcript.

1) If you mean, "hangs", this is fixed by the RecursionLock changes.
Note you can plug them in an existing image with

  Transcript instVarAt: 1 put: RecursionLock new

2) If you mean, "errors out", that's because Transcript show: only
accepts strings right now.  It is a synonym for "nextPutAll:".

I might make it a synonym for "display:" instead.  Before going on
blindly, mailing list people, what do you think?  This will have a
change for  "Transcript show: #($a $b $c)", i.e.

st> Transcript show: #($a $b $c)   "how it is now"
abc

st> Transcript display: #($a $b $c)   "how it would be"
($a $b $c )

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re: Transcript cf printNl

Stephen-71


> 1) If you mean, "hangs", this is fixed by the RecursionLock changes.
> Note you can plug them in an existing image with
>
>   Transcript instVarAt: 1 put: RecursionLock new
>
> 2) If you mean, "errors out", that's because Transcript show: only
> accepts strings right now.  It is a synonym for "nextPutAll:".
>

Re my comment about 'Transcript show: myVar class' giving an error. I
had thought there was still a problem, however, I see the output of the
class selector is a class and not a string. Just one of things on an
unfamiliar system, where a system error plus a user error can have one
thinking there is still a system error.

Re my 2c on making 'show:' a synonym for 'display:'. Yes, this is simpler ..
        Transcript display: 23.
But if I'm using Transcript, then I'm usually printing text as well, and  so
        Transcript display: 'MyInt is: ',myInt.   "->error"
and one still has to do the conversion anway, i.e.
        Transcript display: 'MyInt is: ',myint displayString.
is the same as
        Transcript show:    'MyInt is: ',myint displayString.

       
Also confirming I added the line you provided,
        'Transcript instVarAt: 1 put: RecursionLock new'
     into the start of the script with class output and it stopped the hang.

Thanks
Stephen


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re: Transcript cf printNl

Paolo Bonzini-2

> Also confirming I added the line you provided,
>     'Transcript instVarAt: 1 put: RecursionLock new'
>     into the start of the script with class output and it stopped the hang.

Of course, you can just do it in the image you're using:

    $ gst
    st> Transcript instVarAt: 1 put: RecursionLock new
    st> ObjectMemory snapshot; quit

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk