Skip to content

Commit

Permalink
Tweaked printing methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
robby-phd committed Mar 4, 2025
1 parent 40516dd commit f1d8ec6
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,44 +76,44 @@ trait PackageTrait {
as.size match {
case 0 =>
System.out.println()
System.out.flush()
case 1 =>
System.out.println(as(0))
System.out.flush()
case _ =>
for (a <- as) System.out.print(a)
System.out.println()
System.out.flush()
}
System.out.flush()
System.err.flush()
}

final def print(as: Any*): Unit = {
for (a <- as) {
System.out.print(a)
System.out.flush()
}
System.out.flush()
System.err.flush()
}

final def eprintln(as: Any*): Unit = {
as.size match {
case 0 =>
System.err.println()
System.err.flush()
case 1 =>
System.err.println(as(0))
System.err.flush()
case _ =>
for (a <- as) System.err.print(a)
System.err.println()
System.err.flush()
}
System.err.flush()
System.out.flush()
}

final def eprint(as: Any*): Unit = {
for (a <- as) {
System.err.print(a)
System.err.flush()
}
System.err.flush()
System.out.flush()
}

import language.implicitConversions
Expand Down

0 comments on commit f1d8ec6

Please sign in to comment.