Post: table of contents
Filter:
Classes | Files

Post : Object

posts text to the post window
Source: IOStream.sc

Description

The class Post is a stream destination. Its main use is that it can sometimes make code more readable and execution slightly more efficient.

Post <<< a << " " <<< b << " " <<< c << " " <<< d << Char.nl;

vs

(a.asCompileString + b.asCompileString + c.asCompileString + d.asCompileString).postln;
WARNING: << also means object left shift.

Class Methods

Post.<<(item)

Post as string

Post << "string";

Post.<<<(item)

Post as compile string

Post <<< "string";

Post.comma

Prints a comma

Post.comma;

Post.space

Prints a space

Post.space;

Post.nl

Prints a newline

Post.nl;

Post.ff

Prints the char $\f

Post.ff;

Post.tab

Prints a tab

Post.tab;

Inherited class methods

Undocumented class methods

Post.<<*(collection)

Post.<<<*(collection)

Post.close

Post.formats

Post.formats = value

Post.put(item)

Post.putAll(aCollection)

Instance Methods

Inherited instance methods

Examples

a = "a string";
b = 'a symbol';
c = 4;
d = [1,2,3,4,a,b];

// post as string
Post << a << Char.nl;
// post as compile string
Post <<< a << Char.nl;

// post as string
Post << d << Char.nl;
// post as compile string
Post <<< d << Char.nl;

//This is the equivalent of :
d.postln;
//or
d.asCompileString.postln;