Talk to $person about $topic

Hi again!

I am trying to make it so that “talk to $ about $” is understood and is the redirect target of “ask $ about $” and “tell $ about $”. Here is what I have:

(understand [talk to | $words] as [talk to $person about $topic])
    *(split $words by [about] into $left and $right)
    *(understand $left as single object $person preferably animate)
    *(understand $right as topic $topic)

(perform [ask $person about $topic])
    (try [talk to $person about $topic])

(perform [tell $person about $topic])
    (try [talk to $person about $topic])

This does not work, I get for “talk to person about topic”: “(I only understood you as far as wanting to talk to someone.)” I will note that “talk to person” works fine. Any idea what I am doing wrong? (For that matter I think “talk to $ about $” should probably be in the standard library as the standard redirect for “ask $ about $” and “tell $ about $”, redirecting to “talk to $”.)

1 Like

This was a tricky one. Turns out there is a rewrite rule at work. From the standard library:

(rewrite [talk to | $Words] into [talk | $Words])

and then

(understand [talk/speak | $Words] as [talk to $Obj])
        *(understand $Words as single object $Obj preferably animate)

So you could modify your rule to:

(understand [talk | $Words] as [talk to $Obj about $Topic])
        *(split $Words by [about] into $Left and $Right)
        *(understand $Left as single object $Obj preferably animate)
        *(understand $Right as topic $Topic)

I will reconsider this approach in the library, because it is clearly confusing. Perhaps rewriting should be reserved for the story author.

I’ll also think about adding “talk to / about” as a default verb. Thanks for the suggestion!

By the way, you are also going to need this:

(refuse [talk to $Obj about $])
        (just) (when $Obj is not here)

because the default is to refuse any action involving an object that’s out of reach.

2 Likes

Thanks again, always cool learning new things about the code!

1 Like