[alicebot-archcomm] <set> tag, and clearing predicates

Kim Sullivan alicebot-archcomm@list.alicebot.org
Wed, 11 Dec 2002 01:12:36 +0100


> You only need exists. In AIML, anything that exists has a value,
> everything
> that doesn't exist has no value (the empty string). In my interpreter,
> whenever there is AIML which attempts to retrieve a value of
> something that
> doesn't exist (an out-of-bounds <star/> index, <get/> for something that
> isn't <set/>), it returns an empty string. So I think exists in
> <condition>
> would be only natural to represent the empty string.

You could write exists like

<condition name="x" value="*">x exists</condition>
<condition name="x" value="">x doesn't exist</condition>

Which saves us the hassle of introducing a new attribute :-)

>
> Perhaps for the <predicates> section, and the likes.
>

Yes, but do we agree on this? Program P supports D-style startup.xml (and
the accompanying files) but what about the other interpreters?


> > False. I think that having this "default" value that is returned every
> time
> > a variable is empty is a bad idea. Having a way to initialize
> variables is
> > OK.
>
> Perhaps so, but isn't that the whole point of it being a default
> value? It's
> like how ProgramD returns "undefined" for most predicates when you use
> <get/>.

Yes, and this is exactly what I don't like. There's no way to differentiate
between the "true" default value, and a value that is just the same as the
default value. But, since the global 'default' value is set separately from
the categories (and in D's case separately from the AIML startup files as
well, it's configured in the D-specific server.properties file), how can I
reliably test it? I mean, someone uses "undefined", someone else might use
"undefiniert", "N/A" and the whole notion of the global default becomes
pointless.

If I personally had to specify a default value, it would be an empty string
and I'd use a more flexible mechanism, like <get
name="name"><random><li>user</li><li>master</li></random></get> - this calls
the user either by his name (if it's known) or user or master. You could
also check the users gender (if known) and alternate between master and
mistress. Of course, you can write this with a condition as well, but for
simple cases, <get name="name">user</get> is much more convenient than
<condition name="name">
<li value="*><get name="name"/></li>
<li>user</li>
</condition

or

<condition name="name">
<li exists=""><get name="name"/></li>
<li>user</li>
</condition>

(BTW, is this how you'd use the exists attribute?)

Kim