commonMain.it.unibo.tuprolog.solve.stdlib.primitive.NewLine.kt Maven / Gradle / Ivy
package it.unibo.tuprolog.solve.stdlib.primitive
import it.unibo.tuprolog.solve.ExecutionContext
import it.unibo.tuprolog.solve.primitive.PredicateWithoutArguments
import it.unibo.tuprolog.solve.primitive.Solve
object NewLine : PredicateWithoutArguments.NonBacktrackable("nl") {
override fun Solve.Request.computeOne(): Solve.Response {
return context.outputChannels.current.let {
if (it == null) {
replyFail()
} else {
it.write("\n")
replySuccess()
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy