xor method
Returns Some if exactly one of self, other
is Some, otherwise returns None.
Implementation
Option<T> xor(Option<T> other) {
if (v == null) {
if (other.isSome()) {
return other;
}
return None;
} else {
if (other.isSome()) {
return None;
}
return Some(v!);
}
}