| 1 | |
|---|
| 2 | :- protocol(loopp). |
|---|
| 3 | |
|---|
| 4 | :- info([ |
|---|
| 5 | version is 1.1, |
|---|
| 6 | author is 'Paulo Moura', |
|---|
| 7 | date is 2006/9/17, |
|---|
| 8 | comment is 'Loop control structures protocol.']). |
|---|
| 9 | |
|---|
| 10 | :- public(dowhile/2). |
|---|
| 11 | :- meta_predicate(dowhile(::, ::)). |
|---|
| 12 | :- mode(dowhile(+callable, @callable), zero_or_one). |
|---|
| 13 | :- info(dowhile/2, [ |
|---|
| 14 | comment is 'Do Action while Condition is true.', |
|---|
| 15 | argnames is ['Action', 'Condition']]). |
|---|
| 16 | |
|---|
| 17 | :- public(forto/3). |
|---|
| 18 | :- meta_predicate(forto(*, *, ::)). |
|---|
| 19 | :- mode(forto(+integer, +integer, @callable), zero_or_one). |
|---|
| 20 | :- info(forto/3, [ |
|---|
| 21 | comment is 'Counting from First to Last do Call.', |
|---|
| 22 | argnames is ['First', 'Last', 'Call']]). |
|---|
| 23 | |
|---|
| 24 | :- public(forto/4). |
|---|
| 25 | :- meta_predicate(forto(*, *, *, ::)). |
|---|
| 26 | :- mode(forto(-integer, +integer, +integer, @callable), zero_or_one). |
|---|
| 27 | :- info(forto/4, [ |
|---|
| 28 | comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.', |
|---|
| 29 | argnames is ['Count', 'First', 'Last', 'Call']]). |
|---|
| 30 | |
|---|
| 31 | :- public(fordownto/3). |
|---|
| 32 | :- meta_predicate(fordownto(*, *, ::)). |
|---|
| 33 | :- mode(fordownto(+integer, +integer, @callable), zero_or_one). |
|---|
| 34 | :- info(fordownto/3, [ |
|---|
| 35 | comment is 'Counting from First to Last do Call.', |
|---|
| 36 | argnames is ['First', 'Last', 'Call']]). |
|---|
| 37 | |
|---|
| 38 | :- public(fordownto/4). |
|---|
| 39 | :- meta_predicate(fordownto(*, *, *, ::)). |
|---|
| 40 | :- mode(fordownto(-integer, +integer, +integer, @callable), zero_or_one). |
|---|
| 41 | :- info(fordownto/4, [ |
|---|
| 42 | comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.', |
|---|
| 43 | argnames is ['Count', 'First', 'Last', 'Call']]). |
|---|
| 44 | |
|---|
| 45 | :- public(whiledo/2). |
|---|
| 46 | :- meta_predicate(whiledo(::, ::)). |
|---|
| 47 | :- mode(whiledo(+callable, @callable), zero_or_one). |
|---|
| 48 | :- info(whiledo/2, [ |
|---|
| 49 | comment is 'While Condition is true do Action.', |
|---|
| 50 | argnames is ['Condition', 'Action']]). |
|---|
| 51 | |
|---|
| 52 | :- end_protocol. |
|---|