Changeset 4600
- Timestamp:
- 11/21/08 15:34:32 (7 weeks ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
compiler/logtalk.pl (modified) (1 diff)
-
examples/expansion/expansion.lgt (modified) (2 diffs)
-
examples/expansion/SCRIPT.txt (modified) (3 diffs)
-
RELEASE_NOTES.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/compiler/logtalk.pl
r4599 r4600 2976 2976 % expand_goal/2 built-in method 2977 2977 2978 '$lgt_expand_goal'(Obj, Goal, E xpansion, Sender, Scope) :-2978 '$lgt_expand_goal'(Obj, Goal, EGoal, Sender, Scope) :- 2979 2979 ( var(Goal) -> 2980 E xpansion= Goal2981 ; '$lgt_goal_expansion'(Obj, Goal, Expand , Sender, Scope) ->2982 Expansion = Expand2983 ; E xpansion= Goal2980 EGoal = Goal 2981 ; '$lgt_goal_expansion'(Obj, Goal, Expanded, Sender, Scope) -> 2982 '$lgt_expand_goal'(Obj, Expanded, EGoal, Sender, Scope) 2983 ; EGoal = Goal 2984 2984 ). 2985 2985 -
trunk/examples/expansion/expansion.lgt
r3936 r4600 14 14 term_expansion(9, nine). 15 15 16 goal_expansion(write(Term), writeq(Term)). 17 goal_expansion(writeq(Term), write_term(Term, [quoted(true)])). 18 16 19 :- end_category. 17 20 … … 19 22 :- category(conversion_test). 20 23 21 :- public(test /2).24 :- public(test_term/2). 22 25 23 test (Term, Expansion) :-26 test_term(Term, Expansion) :- 24 27 expand_term(Term, Expansion). 28 29 :- public(test_goal/2). 30 31 test_goal(Goal, EGoal) :- 32 expand_goal(Goal, EGoal). 25 33 26 34 :- end_category. -
trunk/examples/expansion/SCRIPT.txt
r4572 r4600 16 16 17 17 18 % simple tests of the expand_term/2 built-in method:18 % simple tests of the expand_term/2 and expand_goal/2 built-in methods: 19 19 20 20 | ?- exp_public::expand_term(8, Term). … … 23 23 yes 24 24 25 | ?- exp_public::expand_goal(write(Term), EGoal). 26 27 EGoal = write_term(Term, [quoted(true)]). 28 yes 29 30 25 31 | ?- exp_protected::expand_term(8, Term). 26 32 27 33 Term = 8 28 34 yes 35 36 | ?- exp_protected::expand_goal(write(Term), EGoal). 37 38 EGoal = write(Term). 39 yes 40 29 41 30 42 | ?- exp_private::expand_term(8, Term). … … 33 45 yes 34 46 35 | ?- desc_public::test(8, Term). 47 | ?- exp_private::expand_goal(write(Term), EGoal). 48 49 EGoal = write(Term). 50 yes 51 52 53 | ?- desc_public::test_term(8, Term). 36 54 37 55 Term = eight 38 56 yes 39 57 40 | ?- desc_protected::test(8, Term). 58 | ?- desc_public::test_goal(write(Term), EGoal). 59 60 EGoal = write_term(Term, [quoted(true)]) 61 yes 62 63 64 | ?- desc_protected::test_term(8, Term). 41 65 42 66 Term = eight 43 67 yes 44 68 45 | ?- desc_private::test(8, Term). 69 | ?- desc_protected::test_goal(write(Term), EGoal). 70 71 EGoal = write_term(Term, [quoted(true)]) 72 yes 73 74 75 | ?- desc_private::test_term(8, Term). 46 76 47 77 Term = 8 48 78 yes 79 80 | ?- desc_private::test_goal(write(Term), EGoal). 81 82 EGoal = write(Term) 83 yes -
trunk/RELEASE_NOTES.txt
r4599 r4600 58 58 to illustrate the use of some of the meta-predicates implemented in the 59 59 Logtalk library. 60 61 Updated the "expansion" example to illustrate the new expand_goal/2 62 built-in method. 60 63 61 64 Added an example, "cc", of using conditional compilation directives to
