Skip to content

Instantly share code, notes, and snippets.

@MrJaba
Created June 9, 2009 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrJaba/126513 to your computer and use it in GitHub Desktop.
Save MrJaba/126513 to your computer and use it in GitHub Desktop.
import scala.io.Source
object ListComparer{
def main( args: Array[String] ){
if( args.length == 2 ){
println( listDifferences( args(0), args(1) ) )
}
else
Console.err.println( "Needs two filenames")
}
def listDifferences( fileA: String, fileB: String ): List[String] = {
val listA = Source.fromFile( fileA ).getLines.toList
val listB = Source.fromFile( fileB ).getLines.toList
listA -- listB
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment