[alicebot-archcomm] <set> and unsetting them
Dr. Rich Wallace
drwallace at alicebot.org
Sat Oct 7 09:46:35 PDT 2006
Yes but you can say
<category>
<pattern>BRANCH ON PREDICATE</pattern>
<template><srai>BRANCH <get name="somepred"/></srai></template>
</category>
<category>
<pattern>BRANCH *</pattern>
<template>The branch goes here if the predicate is set</template>
</category>
<category>
<pattern>BRANCH</pattern>
<template>The branch goes here if the predicate is set to the empty
string.</template>
</category>
In Pandorabots, the default predicate value is the empty string unless the
botmaster sets it to something else, like OM.
The example
<condition name="pred" value="">
should be false because, as you said, it uses AIML pattern matching,
rather than a test for equality.
Rich
> Dr. Rich Wallace wrote:
>
>> I would say, set to the empty string.
>
> This doesn't really fit with the fact that the predicate content is
> defined as an AIML pattern, which is defined as one or more words ("*"
> not having standard 'Kleene star' semantics has been an issue here
> before). At least according to the spec, you shouldn't be able to test
>
> <condition name="foo" value="">
>
> since there is no "empty string" in AIML. I find this unfortunate, but
> that's the way you wanted it, and it's too late to change now without
> breaking lots.
>
> The way I write it is that there always has to be a default value, and
> code that "consumes" some predicate value has to replace it with the
> default. I thought that Pandorabots works like this, too - they don't
> let you test for the empty string, but for a default "OM" value.
>
> Dirk
>
More information about the alicebot-archcomm
mailing list