voddan
fun <P1, R> Function1<P1, R>.isDefinedAt(p: P1): Boolean = try { this.invoke(p) true } catch(e: Exception) { false }