def hasName(name: String, expr: Expression) = expr match {
case ce: ConstantExpression => ce.getValue == name
case _ => false
}