2001-06-06 20:40:57 +01:00
|
|
|
|
|
|
|
:- protocol(loopp).
|
|
|
|
|
|
|
|
:- info([
|
2006-11-07 17:11:47 +00:00
|
|
|
version is 1.1,
|
2003-02-05 00:15:28 +00:00
|
|
|
author is 'Paulo Moura',
|
2006-11-07 17:11:47 +00:00
|
|
|
date is 2006/9/17,
|
2001-06-06 20:40:57 +01:00
|
|
|
comment is 'Loop control structures protocol.']).
|
|
|
|
|
|
|
|
:- public(dowhile/2).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(dowhile(::, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(dowhile(+callable, @callable), zero_or_one).
|
|
|
|
:- info(dowhile/2, [
|
|
|
|
comment is 'Do Action while Condition is true.',
|
|
|
|
argnames is ['Action', 'Condition']]).
|
|
|
|
|
|
|
|
:- public(forto/3).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(forto(*, *, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(forto(+integer, +integer, @callable), zero_or_one).
|
|
|
|
:- info(forto/3, [
|
|
|
|
comment is 'Counting from First to Last do Call.',
|
|
|
|
argnames is ['First', 'Last', 'Call']]).
|
|
|
|
|
|
|
|
:- public(forto/4).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(forto(*, *, *, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(forto(-integer, +integer, +integer, @callable), zero_or_one).
|
|
|
|
:- info(forto/4, [
|
|
|
|
comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.',
|
|
|
|
argnames is ['Count', 'First', 'Last', 'Call']]).
|
|
|
|
|
|
|
|
:- public(fordownto/3).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(fordownto(*, *, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(fordownto(+integer, +integer, @callable), zero_or_one).
|
|
|
|
:- info(fordownto/3, [
|
|
|
|
comment is 'Counting from First to Last do Call.',
|
|
|
|
argnames is ['First', 'Last', 'Call']]).
|
|
|
|
|
|
|
|
:- public(fordownto/4).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(fordownto(*, *, *, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(fordownto(-integer, +integer, +integer, @callable), zero_or_one).
|
|
|
|
:- info(fordownto/4, [
|
|
|
|
comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.',
|
|
|
|
argnames is ['Count', 'First', 'Last', 'Call']]).
|
|
|
|
|
|
|
|
:- public(whiledo/2).
|
2006-11-07 17:11:47 +00:00
|
|
|
:- meta_predicate(whiledo(::, ::)).
|
2001-06-06 20:40:57 +01:00
|
|
|
:- mode(whiledo(+callable, @callable), zero_or_one).
|
|
|
|
:- info(whiledo/2, [
|
|
|
|
comment is 'While Condition is true do Action.',
|
|
|
|
argnames is ['Condition', 'Action']]).
|
|
|
|
|
|
|
|
:- end_protocol.
|