writer

@JvmName(name = "drawerWriter")
fun <T> Drawer.writer(f: TextWriter.() -> T): T(source)
fun <T> Program.writer(f: TextWriter.() -> T): T(source)


fun <T> writer(drawer: Drawer, f: TextWriter.() -> T): T(source)

Executes a block of code using a TextWriter instance initialized with the provided Drawer. The block is guaranteed to be invoked exactly once.

Return

The result of the executed block.

Parameters

T

The return type of the block.

drawer

The Drawer object used to initialize the TextWriter.

f

The block of code to be executed with the TextWriter receiver.