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

Jonathan Roewen alicebot-archcomm@list.alicebot.org
Tue, 10 Dec 2002 22:29:50 +1300


> > 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.
>
> I believe this is not the case. One would think that this behavior applies
> generally to all elements (we've had a discussion about this with Pedro or
> Sherman in the early days of arch, I made the same assumption) but in
> fact, the spec only mentions <person/> <person2/> and <gender/> as valid
> shortcuts of this type. (In case I missed something please point me to the
> paragraph but I'm pretty sure I didn't).

So you are right .. I should've checked the actual spec instead of what I
had ;-) In which case, why isn't there a shortcut for <set/> when there is
for just about everything else that often takes <star/> as a parameter
(<srai>, <person>, <person2>, <gender>). I think <set/> ==
<set><star/></set> and having <clear/> or something, as <clear/> is less
ambiguous, and <set/> would then be just like the other shortcut elements.

> > I believe Kim's ProgramP has a <forget/> tag to achieve the effect of
> > clearing all variables.
>
> You can, however, use <set name="variable"/> too.
>
> Generally I don't think it's that much necessary to differentiate between
> "empty" and "non-existent" variables, especially in languages where you
> don't need to declare a variable before using it, and all variables are
> dynamically typed (or no types exist).

Yeah I guess so.

> What does bother me is the fact that you can't test for an empty value,
> and a single wildcard usually matches an empty string (going against the
> "one or more words" definition).

I don't see why you can't do this. Doesn't <li value=""> achieve this?
Though, personally, I'd prefer having <li exists="true|false"> instead.

> Kim

Jon