[alicebot-archcomm] <set> tag, and clearing predicates
Jonathan Roewen
alicebot-archcomm@list.alicebot.org
Tue, 10 Dec 2002 09:12:05 +1300
Hi,
I think this has to be cleared up, as I see it used widely in AIML sets for
clearing values of predicates, which is wrong (I think).
<set name="some-predicate"></set> does not clear a variable (not in J-Alice
anyways).
I may be wrong, but doesn't XML define that any tag which has empty content
can be shortened to the self-closing variant. So, the above AIML can become
<set name="some-predicate"/>, which, as defined in the AIML spec, is the
shortcut element for <set name="some-predicate"><star/></set>, which is not
what one wanted. Provided the category has no wildcards, the effect would
indeed be achieved, as the stack is empty, producing the empty string.
However, if there is at least one wildcard, it would no longer be doing what
was intended.
I believe Kim's ProgramP has a <forget/> tag to achieve the effect of
clearing all variables. However, I propose that the AIML spec introduces one
new tag to circumvent this problem, as clearing variables is a necessity at
times.
I would like to see <clear name="some-predicate"/> be added, for clearing
the variable from the bot's memory/knowledge.
This could allow empty predicates to indeed be valid values, with a cleared
predicate being non-existing, however, this is a different issue and would
require other changes if it were to be interpreted this way. For example,
would require <condition name="some-predicate" exists="false"> to test for a
non-existing predicate.
Jon =)