Take notes on the command line: Difference between revisions

Line 1,549:
{{libheader|Scala}}
<lang scala>import java.io.{ FileNotFoundException, FileOutputStream, PrintStream }
import java.utiltime.DateLocalDateTime
 
object TakeNotes extends App {
Line 1,555:
if (args.length > 0) {
val ps = new PrintStream(new FileOutputStream(notesFileName, true))
ps.println(new DateLocalDateTime.now() + args.mkString("\n\t", " ", "."))
ps.close()
} else try {
io.Source.fromFile(notesFileName).getLines().foreach { line => (println(line) }
} catch {
case e: FileNotFoundException => println(e.getLocalizedMessage())
Line 1,567:
}
}</lang>
 
=={{header|Scheme}}==
(moved from Racket)
Anonymous user