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/Functor1.cs | |
parent | Thank you, tyre, for a patch that fixes a null reference in LSL (diff) | |
download | opensim-SC-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.zip opensim-SC-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.tar.gz opensim-SC-323ada012d3bed0c6f7a6d5d0ee14b409b7457c7.tar.bz2 opensim-SC-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 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs index 69fbeee..351114d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs | |||
@@ -49,6 +49,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
49 | { | 49 | { |
50 | } | 50 | } |
51 | 51 | ||
52 | // disable warning on l1, don't see how we can | ||
53 | // code this differently | ||
54 | #pragma warning disable 0168 | ||
55 | /// <summary> | ||
56 | /// If arg is another Functor1, then succeed (yield once) if this and arg have the | ||
57 | /// same name and the functor args unify, otherwise fail (don't yield). | ||
58 | /// If arg is a Variable, then call its unify to unify with this. | ||
59 | /// Otherwise fail (don't yield). | ||
60 | /// </summary> | ||
61 | /// <param name="arg"></param> | ||
62 | /// <returns></returns> | ||
52 | public IEnumerable<bool> unify(object arg) | 63 | public IEnumerable<bool> unify(object arg) |
53 | { | 64 | { |
54 | arg = YP.getValue(arg); | 65 | arg = YP.getValue(arg); |
@@ -57,25 +68,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
57 | Functor1 argFunctor = (Functor1)arg; | 68 | Functor1 argFunctor = (Functor1)arg; |
58 | if (_name.Equals(argFunctor._name)) | 69 | if (_name.Equals(argFunctor._name)) |
59 | { | 70 | { |
60 | // disable warning on l1, don't see how we can | ||
61 | // code this differently | ||
62 | #pragma warning disable 0168 | ||
63 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) | 71 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) |
64 | yield return false; | 72 | yield return false; |
65 | #pragma warning restore 0168 | ||
66 | } | 73 | } |
67 | } | 74 | } |
68 | else if (arg is Variable) | 75 | else if (arg is Variable) |
69 | { | 76 | { |
70 | // disable warning on l1, don't see how we can | ||
71 | // code this differently | ||
72 | #pragma warning disable 0168 | ||
73 | foreach (bool l1 in ((Variable)arg).unify(this)) | 77 | foreach (bool l1 in ((Variable)arg).unify(this)) |
74 | yield return false; | 78 | yield return false; |
75 | #pragma warning restore 0168 | ||
76 | |||
77 | } | 79 | } |
78 | } | 80 | } |
81 | #pragma warning restore 0168 | ||
82 | |||
79 | 83 | ||
80 | public override string ToString() | 84 | public override string ToString() |
81 | { | 85 | { |