From c1dcb1d75d1010174efd4ba940fc81a79c5ccae2 Mon Sep 17 00:00:00 2001 From: Ulrich Neumerkel Date: Thu, 28 May 2009 19:23:43 +0200 Subject: [PATCH] FIX #85 (defaultyness & meta_predicate), and thus #84, #82, #69 --- pl/signals.yap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pl/signals.yap b/pl/signals.yap index e3493891d..cdd121ce0 100644 --- a/pl/signals.yap +++ b/pl/signals.yap @@ -211,6 +211,10 @@ on_signal(Signal,OldAction,default) :- '$reset_signal'(Signal, OldAction). on_signal(Signal,OldAction,Action) :- var(Action), !, + throw(error(system_error,'Somehow the meta_predicate declarations of on_signal are subverted!')). +on_signal(Signal,OldAction,Action) :- + Action = (_:Goal), + var(Goal), !, '$check_signal'(Signal, OldAction), Action = OldAction. on_signal(Signal,OldAction,Action) :- @@ -234,6 +238,10 @@ on_signal(Signal,OldAction,Action) :- '$check_signal'(_, default). +alarm(Interval, Goal, Left) :- + Interval == 0, !, + on_signal(sig_alarm, _, Goal), + '$alarm'(Interval, 0, Left, _). alarm(Interval, Goal, Left) :- integer(Interval), !, on_signal(sig_alarm, _, Goal),