Changeset 4089 for trunk/library
- Timestamp:
- 02/15/08 04:02:58 (11 months ago)
- Location:
- trunk/library
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/library/loop.lgt
r3694 r4089 4 4 5 5 :- info([ 6 version is 1. 1,6 version is 1.2, 7 7 author is 'Paulo Moura', 8 date is 200 6/9/17,8 date is 2008/2/15, 9 9 comment is 'Loop control structures predicates.']). 10 10 … … 23 23 24 24 :- meta_predicate(forto(*, *, ::)). 25 forto(First, Last, Call) :- 25 forto(FirstExp, LastExp, Call) :- 26 First is FirstExp, 27 Last is LastExp, 26 28 ( First =< Last -> 27 29 \+ \+ call(Call), … … 32 34 33 35 :- meta_predicate(forto(*, *, *, ::)). 34 forto(Count, First, Last, Call) :- 36 forto(Count, FirstExp, LastExp, Call) :- 37 First is FirstExp, 38 Last is LastExp, 35 39 ( First =< Last -> 36 40 \+ \+ (Count = First, call(Call)), … … 41 45 42 46 :- meta_predicate(fordownto(*, *, ::)). 43 fordownto(First, Last, Call) :- 47 fordownto(FirstExp, LastExp, Call) :- 48 First is FirstExp, 49 Last is LastExp, 44 50 ( First >= Last -> 45 51 \+ \+ call(Call), … … 50 56 51 57 :- meta_predicate(fordownto(*, *, *, ::)). 52 fordownto(Count, First, Last, Call) :- 58 fordownto(Count, FirstExp, LastExp, Call) :- 59 First is FirstExp, 60 Last is LastExp, 53 61 ( First >= Last -> 54 62 \+ \+ (Count = First, call(Call)), -
trunk/library/loopp.lgt
r3688 r4089 3 3 4 4 :- info([ 5 version is 1. 1,5 version is 1.2, 6 6 author is 'Paulo Moura', 7 date is 200 6/9/17,8 comment is 'Loop control structures protocol.']).7 date is 2008/2/15, 8 comment is 'Loop control constructs protocol.']). 9 9 10 10 :- public(dowhile/2). … … 19 19 :- mode(forto(+integer, +integer, @callable), zero_or_one). 20 20 :- info(forto/3, [ 21 comment is 'Counting from First to Last do Call. ',21 comment is 'Counting from First to Last do Call. For convenience and clarity, First and Last can be arithmetic expressions.', 22 22 argnames is ['First', 'Last', 'Call']]). 23 23 … … 26 26 :- mode(forto(-integer, +integer, +integer, @callable), zero_or_one). 27 27 :- info(forto/4, [ 28 comment is 'Do Call counting from First to Last and instantiating Count to each suc essive value.',28 comment is 'Do Call counting from First to Last and instantiating Count to each successive value. For convenience and clarity, First and Last can be arithmetic expressions.', 29 29 argnames is ['Count', 'First', 'Last', 'Call']]). 30 30 … … 33 33 :- mode(fordownto(+integer, +integer, @callable), zero_or_one). 34 34 :- info(fordownto/3, [ 35 comment is 'Counting from First to Last do Call. ',35 comment is 'Counting from First to Last do Call. For convenience and clarity, First and Last can be arithmetic expressions.', 36 36 argnames is ['First', 'Last', 'Call']]). 37 37 … … 40 40 :- mode(fordownto(-integer, +integer, +integer, @callable), zero_or_one). 41 41 :- info(fordownto/4, [ 42 comment is 'Do Call counting from First to Last and instantiating Count to each suc essive value.',42 comment is 'Do Call counting from First to Last and instantiating Count to each successive value. For convenience and clarity, First and Last can be arithmetic expressions.', 43 43 argnames is ['Count', 'First', 'Last', 'Call']]). 44 44
