A relaxed chat room about all things Scala. Beginner questions welcome. http://scala-lang.org/conduct/ applies
SethTisue on 2.12.x
advance expecty (compare)
val x = { val a = 7; val x = 3*a; x }
type stuff.
(fromCount, toCount) match { case (Some(fc), Some(tc)) => ...; case _ => logger.error... }
I suppose.
var
s and mutable structures
var result = false
if (bad_thing) {
log("Bad")
}
else if (other_bad_thing) {
log("Even worse")
}
else result = true
result
IO
yet, I would not introudce them just for this.
(fromCount, toCount) match {
case (None, None) =>
logger.error(s"error processing $from: could not validate counts")
false
case (Some(from), Some(to)) if (form != to) =>
logger.error(s"error processing $from: counts do not match: ${from}, ${to}")
case _ =>
logger.info(s"creating _SUCCESS file for $to")
destination.s3.putObject(bucket, to + "_SUCCESS", "")
true
}
(I would prefix the Option values with opt)