diff options
author | Charles Krinke | 2008-08-13 14:13:49 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-13 14:13:49 +0000 |
commit | 323ada012d3bed0c6f7a6d5d0ee14b409b7457c7 (patch) | |
tree | d5a2e30707baba7804aefb341774d6d51ca7b439 /OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs | |
parent | Thank you, tyre, for a patch that fixes a null reference in LSL (diff) | |
download | opensim-SC_OLD-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.zip opensim-SC_OLD-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.tar.gz opensim-SC_OLD-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.tar.bz2 opensim-SC_OLD-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.tar.xz |
Mantis#1931. Thank you kindly, Kinoc for a patch that:
* Yield Prolog 1.0.1 Released : it passes all but 9 of the
421 tests in the ISO Prolog test suite (97.8%) .
* support dynamic predicates and rules.
* support 'import' to use external static functions
improves connection to C# functions
* Matches Yield Prolog r831
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs index 4ae325e..6817d11 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs | |||
@@ -51,6 +51,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | // disable warning on l1, don't see how we can | ||
55 | // code this differently | ||
56 | #pragma warning disable 0168 | ||
57 | /// If arg is another Functor2, then succeed (yield once) if this and arg have the | ||
58 | /// same name and all functor args unify, otherwise fail (don't yield). | ||
59 | /// If arg is a Variable, then call its unify to unify with this. | ||
60 | /// Otherwise fail (don't yield). | ||
54 | public IEnumerable<bool> unify(object arg) | 61 | public IEnumerable<bool> unify(object arg) |
55 | { | 62 | { |
56 | arg = YP.getValue(arg); | 63 | arg = YP.getValue(arg); |
@@ -59,27 +66,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
59 | Functor2 argFunctor = (Functor2)arg; | 66 | Functor2 argFunctor = (Functor2)arg; |
60 | if (_name.Equals(argFunctor._name)) | 67 | if (_name.Equals(argFunctor._name)) |
61 | { | 68 | { |
62 | // disable warning: don't see how we can code this differently short | ||
63 | // of rewriting the whole thing | ||
64 | #pragma warning disable 0168 | ||
65 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) | 69 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) |
66 | { | 70 | { |
67 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) | 71 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) |
68 | yield return false; | 72 | yield return false; |
69 | } | 73 | } |
70 | #pragma warning restore 0168 | ||
71 | } | 74 | } |
72 | } | 75 | } |
73 | else if (arg is Variable) | 76 | else if (arg is Variable) |
74 | { | 77 | { |
75 | // disable warning: don't see how we can code this differently short | ||
76 | // of rewriting the whole thing | ||
77 | #pragma warning disable 0168 | ||
78 | foreach (bool l1 in ((Variable)arg).unify(this)) | 78 | foreach (bool l1 in ((Variable)arg).unify(this)) |
79 | yield return false; | 79 | yield return false; |
80 | #pragma warning restore 0168 | ||
81 | } | 80 | } |
82 | } | 81 | } |
82 | #pragma warning restore 0168 | ||
83 | |||
83 | 84 | ||
84 | public override string ToString() | 85 | public override string ToString() |
85 | { | 86 | { |