Allow ! and - operators on sequence values

This commit is contained in:
John Wiegley 2009-11-18 16:56:58 -05:00
parent 97122cf1f7
commit 9a389650ea

View file

@ -1193,6 +1193,13 @@ void value_t::in_place_negate()
case BALANCE:
as_balance_lval().in_place_negate();
return;
case SEQUENCE: {
value_t temp;
foreach (const value_t& value, as_sequence())
temp.push_back(- value);
*this = temp;
return;
}
default:
break;
}
@ -1222,6 +1229,13 @@ void value_t::in_place_not()
case STRING:
set_boolean(as_string().empty());
return;
case SEQUENCE: {
value_t temp;
foreach (const value_t& value, as_sequence())
temp.push_back(! value);
*this = temp;
return;
}
default:
break;
}