Mercurial > hg > reactive
changeset 11:87c09da8b8ec
Got rid of non-directive initialisations.
author | samer |
---|---|
date | Fri, 24 Feb 2012 18:32:22 +0000 |
parents | 33c1cac37be1 |
children | 24236c9c07b6 44417282afec |
files | qutils.pl |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/qutils.pl Wed Feb 22 21:48:11 2012 +0000 +++ b/qutils.pl Fri Feb 24 18:32:22 2012 +0000 @@ -9,6 +9,12 @@ :- use_module(library(time)). :- use_module(library(debug)). +% Older versions of SWI do not have alarm_at/3 +:- if(\+current_predicate(alarm_at/3)). +%:- writeln('% Expanding alarm_at/3 to alarm_at/4.'). +user:goal_expansion(alarm_at(A,B,C), alarm_at(A,B,C,[])). +:- endif. + %% get_message_or_timeout( +TimeOut, -Msg) is det. % % Time-limited wait for next term in message queue. @@ -18,19 +24,13 @@ % NB: may fail if Msg is bound on input. get_message_or_timeout(inf,Msg) :- !, thread_get_message(Msg). -% Older versions of SWI do not have alarm_at/3 -:- if(\+current_predicate(alarm_at/3)). -:- writeln('% Expanding alarm_at/3 to alarm_at/4.'). -user:goal_expansion(alarm_at(A,B,C), alarm_at(A,B,C,[])). -:- endif. - % Older versions of SWI do not have thread_get_message/3 :- if(current_predicate(thread_get_message/3)). % we have thread_get_message/3 but we may or may not have the deadline/1 option :- if(current_predicate_option(thread_get_message/3,3,deadline(_))). -:- writeln('% compiling get_message_or_timeout/2 using deadline/1 option.'). +%:- writeln('% compiling get_message_or_timeout/2 using deadline/1 option.'). get_message_or_timeout(Deadline,Msg) :- ( get_time(Now), Now<Deadline @@ -42,7 +42,7 @@ :- else. -:- writeln('% compiling get_message_or_timeout/2 using timeout/1 option.'). +%:- writeln('% compiling get_message_or_timeout/2 using timeout/1 option.'). get_message_or_timeout(Deadline,Msg) :- get_time(Now), ( Now>=Deadline @@ -57,7 +57,7 @@ :- else. -:- writeln('% compiling get_message_or_timeout/2 using alarm and message send.'). +%:- writeln('% compiling get_message_or_timeout/2 using alarm and message send.'). get_message_or_timeout(Deadline,Msg) :- get_time(Now), ( Now>=Deadline