drop/1, delete/1
This commit is contained in:
parent
4ec8cba12b
commit
fed10a2a25
12
solution.pl
12
solution.pl
|
@ -81,7 +81,11 @@ and signature later on.
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception.
|
exception.
|
||||||
*/
|
*/
|
||||||
/* drop(Table). */
|
drop(Table) :-
|
||||||
|
(tabl(Table, _) ->
|
||||||
|
delete(Table), retract(tabl(Table, _));
|
||||||
|
throw("Table doesn't exist")
|
||||||
|
).
|
||||||
|
|
||||||
:- dynamic delete/1.
|
:- dynamic delete/1.
|
||||||
/*
|
/*
|
||||||
|
@ -91,7 +95,11 @@ more rows.
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception.
|
exception.
|
||||||
*/
|
*/
|
||||||
/* delete(Table). */
|
delete(Table) :-
|
||||||
|
(tabl(Table, _) ->
|
||||||
|
tabl(Table, C), length(C, L), call(abolish, Table, L);
|
||||||
|
throw("Table doesn't exist")
|
||||||
|
).
|
||||||
|
|
||||||
:- dynamic delete/2.
|
:- dynamic delete/2.
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue