All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ProgramExtensions.kt Maven / Gradle / Ivy

The newest version!
package org.openrndr.extra.textwriter

import org.openrndr.Program
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

@OptIn(ExperimentalContracts::class)
fun  Program.writer(f: TextWriter.() -> T): T {
    contract {
        callsInPlace(f, InvocationKind.EXACTLY_ONCE)
    }
    return writer(drawer, f)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy