| 1 | |
|---|
| 2 | :- protocol(loopp). |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | :- info([ |
|---|
| 6 | version is 1.0, |
|---|
| 7 | authors is 'Paulo Moura', |
|---|
| 8 | date is 2000/7/24, |
|---|
| 9 | comment is 'Loop control structures protocol.']). |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | :- public(dowhile/2). |
|---|
| 13 | :- metapredicate(dowhile(::, ::)). |
|---|
| 14 | |
|---|
| 15 | :- mode(dowhile(+callable, @callable), zero_or_one). |
|---|
| 16 | |
|---|
| 17 | :- info(dowhile/2, [ |
|---|
| 18 | comment is 'Do Action while Condition is true.', |
|---|
| 19 | argnames is ['Action', 'Condition']]). |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | :- public(forto/3). |
|---|
| 23 | :- metapredicate(forto(*, *, ::)). |
|---|
| 24 | |
|---|
| 25 | :- mode(forto(+integer, +integer, @callable), zero_or_one). |
|---|
| 26 | |
|---|
| 27 | :- info(forto/3, [ |
|---|
| 28 | comment is 'Counting from First to Last do Call.', |
|---|
| 29 | argnames is ['First', 'Last', 'Call']]). |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | :- public(forto/4). |
|---|
| 33 | :- metapredicate(forto(*, *, *, ::)). |
|---|
| 34 | |
|---|
| 35 | :- mode(forto(-integer, +integer, +integer, @callable), zero_or_one). |
|---|
| 36 | |
|---|
| 37 | :- info(forto/4, [ |
|---|
| 38 | comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.', |
|---|
| 39 | argnames is ['Count', 'First', 'Last', 'Call']]). |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | :- public(fordownto/3). |
|---|
| 43 | :- metapredicate(fordownto(*, *, ::)). |
|---|
| 44 | |
|---|
| 45 | :- mode(fordownto(+integer, +integer, @callable), zero_or_one). |
|---|
| 46 | |
|---|
| 47 | :- info(fordownto/3, [ |
|---|
| 48 | comment is 'Counting from First to Last do Call.', |
|---|
| 49 | argnames is ['First', 'Last', 'Call']]). |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | :- public(fordownto/4). |
|---|
| 53 | :- metapredicate(fordownto(*, *, *, ::)). |
|---|
| 54 | |
|---|
| 55 | :- mode(fordownto(-integer, +integer, +integer, @callable), zero_or_one). |
|---|
| 56 | |
|---|
| 57 | :- info(fordownto/4, [ |
|---|
| 58 | comment is 'Do Call counting from First to Last and instantiating Count to each sucessive value.', |
|---|
| 59 | argnames is ['Count', 'First', 'Last', 'Call']]). |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | :- public(whiledo/2). |
|---|
| 63 | :- metapredicate(whiledo(::, ::)). |
|---|
| 64 | |
|---|
| 65 | :- mode(whiledo(+callable, @callable), zero_or_one). |
|---|
| 66 | |
|---|
| 67 | :- info(whiledo/2, [ |
|---|
| 68 | comment is 'While Condition is true do Action.', |
|---|
| 69 | argnames is ['Condition', 'Action']]). |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | :- end_protocol. |
|---|