--- a/progs/detokenise.scala Mon Nov 18 11:11:11 2019 +0000
+++ b/progs/detokenise.scala Wed Nov 20 17:10:03 2019 +0000
@@ -23,8 +23,11 @@
case class T_STR(s: String) extends Token
def deserialise[T](fname: String) : Try[T] = {
- import scala.util.Using
- Using(new ObjectInputStream(new FileInputStream(fname))) {
+ //import scala.util.Using
+ //Using(new ObjectInputStream(new FileInputStream(fname))) {
+ // in => in.readObject.asInstanceOf[T]
+ //}
+ Try(new ObjectInputStream(new FileInputStream(fname))).get {
in => in.readObject.asInstanceOf[T]
}
}