topaz and transcript?

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

topaz and transcript?

SeanTAllen
If I had a Dictionary or something else, doesnt much matter what, its
just for example.

And I wanted to output something like

key = value

in topaz, how do i do that when printit just returns the last returned value?

Do I output to a transcript? I looked through the topaz guide but cant
find an answer.
Reply | Threaded
Open this post in threaded view
|

Re: topaz and transcript?

James Foster
On Feb 10, 2010, at 11:55 AM, Sean Allen wrote:

> If I had a Dictionary or something else, doesnt much matter what, its
> just for example.
>
> And I wanted to output something like
>
> key = value
>
> in topaz, how do i do that when printit just returns the last returned value?
>
> Do I output to a transcript? I looked through the topaz guide but cant
> find an answer.

As you note, each Topaz run/doit will return the result of the last expression, so it it common to generate a string as the last expression. If you want to send something to standard output, then see GsFile class>>stdout and friends.

topaz 1> run
GsFile stdout nextPutAll: 'this is a test'; lf.
true.
%
this is a test
true
topaz 1>

Topaz doesn't have the concept of a "Transcript".

James
Reply | Threaded
Open this post in threaded view
|

Re: topaz and transcript?

SeanTAllen
On Wed, Feb 10, 2010 at 3:19 PM, James Foster <[hidden email]> wrote:

> On Feb 10, 2010, at 11:55 AM, Sean Allen wrote:
>
>> If I had a Dictionary or something else, doesnt much matter what, its
>> just for example.
>>
>> And I wanted to output something like
>>
>> key = value
>>
>> in topaz, how do i do that when printit just returns the last returned value?
>>
>> Do I output to a transcript? I looked through the topaz guide but cant
>> find an answer.
>
> As you note, each Topaz run/doit will return the result of the last expression, so it it common to generate a string as the last expression. If you want to send something to standard output, then see GsFile class>>stdout and friends.
>
> topaz 1> run
> GsFile stdout nextPutAll: 'this is a test'; lf.
> true.
> %
> this is a test
> true
> topaz 1>
>
> Topaz doesn't have the concept of a "Transcript".

Thanks James.
Reply | Threaded
Open this post in threaded view
|

Re: topaz and transcript?

Dale
In reply to this post by SeanTAllen

----- "Sean Allen" <[hidden email]> wrote:

| If I had a Dictionary or something else, doesnt much matter what, its
| just for example.
|
| And I wanted to output something like
|
| key = value
|
| in topaz, how do i do that when printit just returns the last returned
| value?
|
| Do I output to a transcript? I looked through the topaz guide but
| cant
| find an answer.

A couple more things...

topaz has a help facility, just type 'help' at the topaz prompt and then type a category to get more detailed info.

topaz will provide structured displays for the object returned from an run/doit command. Try something like the following:

display oops
level 2
run
Dictionary new
  at: #a put: 'abc';
  at: #b put: #('abc');
  yourself
%

will output something like the following:

[242545153 sz:26 cls: 101377 Dictionary] a Dictionary
  count           [18 sz:0 cls: 74241 SmallInteger] 2
  tableSize       [58 sz:0 cls: 74241 SmallInteger] 7
  emptySlotHint   [66 sz:0 cls: 74241 SmallInteger] 8
  numEmptySlots   [58 sz:0 cls: 74241 SmallInteger] 7
  unused          [20 sz:0 cls: 76289 UndefinedObject] nil
  #1 [242543361 sz:2 cls: 67073 Association] an Association
    key             [4416001 sz:1 cls: 110849 Symbol] a
    value           [242545665 sz:3 cls: 74753 String] abc

  #2 [20 sz:0 cls: 76289 UndefinedObject] nil
  #3 [20 sz:0 cls: 76289 UndefinedObject] nil
  #4 [20 sz:0 cls: 76289 UndefinedObject] nil
  #5 [242541569 sz:2 cls: 67073 Association] an Association
    key             [4097281 sz:1 cls: 110849 Symbol] b
    value           [242545409 sz:1 cls: 66817 Array] an Array

Then the topaz command:

obj@ 242545409

will list the contsnts of the Array. 242545409 is the oop of the Array.

For large objects, you can 'limit bytes' or 'limit oops' to cut down on the amount of data output.

If you're going to be living/debugging in topaz then getting familiar with the display/level/limit and object commands are a good idea:)


Dale
Reply | Threaded
Open this post in threaded view
|

Re: topaz and transcript?

SeanTAllen
On Wed, Feb 10, 2010 at 5:45 PM, Dale Henrichs
<[hidden email]> wrote:

>
> ----- "Sean Allen" <[hidden email]> wrote:
>
> | If I had a Dictionary or something else, doesnt much matter what, its
> | just for example.
> |
> | And I wanted to output something like
> |
> | key = value
> |
> | in topaz, how do i do that when printit just returns the last returned
> | value?
> |
> | Do I output to a transcript? I looked through the topaz guide but
> | cant
> | find an answer.
>
> A couple more things...
>
> topaz has a help facility, just type 'help' at the topaz prompt and then type a category to get more detailed info.
>
> topaz will provide structured displays for the object returned from an run/doit command. Try something like the following:
>
> display oops
> level 2
> run
> Dictionary new
>  at: #a put: 'abc';
>  at: #b put: #('abc');
>  yourself
> %
>
> will output something like the following:
>
> [242545153 sz:26 cls: 101377 Dictionary] a Dictionary
>  count           [18 sz:0 cls: 74241 SmallInteger] 2
>  tableSize       [58 sz:0 cls: 74241 SmallInteger] 7
>  emptySlotHint   [66 sz:0 cls: 74241 SmallInteger] 8
>  numEmptySlots   [58 sz:0 cls: 74241 SmallInteger] 7
>  unused          [20 sz:0 cls: 76289 UndefinedObject] nil
>  #1 [242543361 sz:2 cls: 67073 Association] an Association
>    key             [4416001 sz:1 cls: 110849 Symbol] a
>    value           [242545665 sz:3 cls: 74753 String] abc
>
>  #2 [20 sz:0 cls: 76289 UndefinedObject] nil
>  #3 [20 sz:0 cls: 76289 UndefinedObject] nil
>  #4 [20 sz:0 cls: 76289 UndefinedObject] nil
>  #5 [242541569 sz:2 cls: 67073 Association] an Association
>    key             [4097281 sz:1 cls: 110849 Symbol] b
>    value           [242545409 sz:1 cls: 66817 Array] an Array
>
> Then the topaz command:
>
> obj@ 242545409
>
> will list the contsnts of the Array. 242545409 is the oop of the Array.
>
> For large objects, you can 'limit bytes' or 'limit oops' to cut down on the amount of data output.
>
> If you're going to be living/debugging in topaz then getting familiar with the display/level/limit and object commands are a good idea:)
>

Excellent. I will do that. Thanks Dale.
Reply | Threaded
Open this post in threaded view
|

Re: topaz and transcript?

Dale
In reply to this post by James Foster

----- "James Foster" <[hidden email]> wrote:

| Topaz doesn't have the concept of a "Transcript".

GLASS on the other hand does have a Transcript.

When GemTools is attached Transcript output is routed to the the GemTools Transcript. If GemTools is not attached, Transcript output is routed to stdout ... If you are running without GLASS or before GLASS is installed, GsFile is the ticket for dumping out messages.

Dale