On Thu, May 10, 2012 at 9:27 AM, Sven Van Caekenberghe <sven@beta9.be> wrote:

On 10 May 2012, at 04:47, Sean P. DeNigris wrote:

> There were several list threads about redirecting the Transcript e.g. to
> stdout... Is this available now in Pharo? If so, how do I redirect it to
> stdout?

Have a look at NonInteractiveTranscript.

----

I am NonInteractiveTranscript, a replacement for Transcript, writing everything to a file or stdout.

This is useful when running headless.

� � � �NonInteractiveTranscript file install.

To connect to the output stream of the virtual machine process choose stdout.

� � � �NonInteractiveTranscript stdout install.

An example, using various methods.

| transcript |
transcript := NonInteractiveTranscript new.
transcript cr; << 'This is a test'; space; print: #(1 2 3).
transcript cr; nextPut: $|; tab; nextPut: $#; nextPutAll: '-1-'; space; print: Float pi.
Collection subclassesDo: [ :each | transcript cr; print: each ].
transcript crShow: 'Done!'.
transcript close.

---

There is more in Pharo than you think ;-)

And even more black magic. Since you can do:

Smalltalk at #Transcript put: NonInteractiveTranscript

hahahah



Sven


--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill








--
Mariano
http://marianopeck.wordpress.com