diff --git a/solution.pl b/solution.pl index f73b64f..3a5062f 100644 --- a/solution.pl +++ b/solution.pl @@ -113,7 +113,11 @@ prompt, but which may include selectors. Selectors are terms of the form +where should be replaced by a column name. (See tests.pl for some concrete usage examples.) */ -/* delete(Table, Conds). */ +delete(Table, Conds) :- + (tabl(Table, _) -> + (rows(tables, Row), \+ (member(Cond, Conds), \+ Cond) -> retract(Row); true); + throw("Table doesn't exist") + ). :- dynamic selec/4. /*