OK, zarf has confirmed that there are deep code reasons why “the number understood” overwrites “the topic understood.” But I’ve tried a shallow dive into parser internals to fix that, like this:
[code]Lab is a room.
Alice is a woman in Lab.
Parsed-number is a number that varies. The parsed-number variable translates into I6 as “parsed_number”.
Temporary-parsed-number is a number that varies.
To cache the topic understood: now temporary-parsed-number is parsed-number.
To restore the topic understood: now parsed-number is temporary-parsed-number.
Asking it numerically about is an action applying to one thing and one number.
Before asking someone about:
cache the topic understood;
if the topic understood matches “[number]”:
try asking the noun numerically about the number understood instead;
restore the topic understood.
Instead of asking someone numerically about:
say “[The noun] says, ‘Go higher! Try [the number understood plus 10]!’”
Instead of asking someone about:
say “[The noun] says ‘[Topic understood], huh?’”
test me with “ask Alice about 5/ask alice about rocks/ask alice about 5 rocks”.[/code]
…an easier thing to do would be to find some code that someone has probably already written to do things like translate the text “256” into the number 256. But this would miss out on spelled-out numbers like “two hundred fifty-six,” which the code I’ve written should catch.
On the other hand, you probably shouldn’t use any code I write that involves I6 hacks without running it by someone who knows what they’re doing better than I.