[alicebot-archcomm] <set> tag, and clearing predicates
Jonathan Roewen
alicebot-archcomm@list.alicebot.org
Tue, 10 Dec 2002 10:01:52 +1300
> Just a quick note. I know this to be true for D, if a variable doesn't
> exist or hasn't been filled and it called than it has a default value.
> Most often the value is the string "undefined". Perhaps we should make
> it know that in order for people to insure that their AIML is indeed
> interpreter neutral they should not <set name="some name"></set> but
> <set name="some name"><get name="standard value"/></set> where the
> variable "standard value" is never set.
Yes, and J-Alice achieves defaults using content of <get/>
> Currently testing whether a variable exists or not is quite easy too.
> One only needs to add the standard value and empty to a condition list
> and all should work OK. I know this is quite a workaround and an extra
> "exist=" to the condition would be quicker. But what would the result of
> a condition be if it the variable didn't exist. Wouldn't it make more
> sense if it were part of the <li>? Like <condition name=""><li
> exist="false">answer</li>. This way you'd have an output if the variable
> didn't exist.
<condition name="some-predicate" exists="false">
...
</condition>
would be equivalent to
<condition name="some-predicate">
<li exists="false">....</li>
</condition>
I thought it would have been implied that it also applied to <li> as well,
being that what is in an <li> can go in the <condition> if I'm not mistaken.
The main issue though is the need of a tag to properly clear a variable.
I'll be introducing it to J-Alice in anycase .. I just think it should be
standard, and part of the spec.
Jon =)