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