[alicebot-archcomm] <set> tag, and clearing predicates
Anne Kootstra
alicebot-archcomm@list.alicebot.org
Mon, 9 Dec 2002 22:03:06 +0100
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.
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.
Just my 2 (euro) cents.
--Anne
> -----Oorspronkelijk bericht-----
> Van: alicebot-archcomm-admin@list.alicebot.org
> [mailto:alicebot-archcomm-admin@list.alicebot.org] Namens
> Jonathan Roewen
> Verzonden: maandag 9 december 2002 21:12
> Aan: alicebot-archcomm@list.alicebot.org
> Onderwerp: [alicebot-archcomm] <set> tag, and clearing predicates
>
>
> 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 =)
>
>
>
> _______________________________________________
> alicebot-archcomm mailing list alicebot-archcomm@list.alicebot.org
> http://list.alicebot.org/mailman/listinfo/alicebot-archcomm
>