curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-2006] [Mantis 2042] Can't use parsed value in when clause for understand as a thing. #78

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : rockwalrus

Description :

In the example below, the condition in the when clause gets executed before the number is parsed, causing it to incorrectly use the value parsed from the previous successfully parsed command, if any.

Steps to reproduce :

There is a room.

Understand "meaning of [number]" as a thing when the number understood is 42.

Test me with "x meaning of 42 / trace 42 / x meaning of 5".

Additional information :

imported from: [Mantis 2042] Can't use parsed value in when clause for understand as a thing.
  • status: Closed
  • resolution: Won't Do
  • resolved: 2022-04-10T03:40:04+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by rockwalrus :
Looks like this is a documented limitation, but the misbehavior is surprising. An error (or doing the expected behavior) would be better.

I was implementing a different way of referring to things, so the documented recommendation of having the understand match everything and then using a check rule for every action wasn't really a good option.

I'm happy enough with the I6 code I wrote to workaround this bug and a limitation of ParseNumber (https://inform7.uservoice.com/forums/57320-general/suggestions/32588690-parse-larger-numbers), but it's theoretically possible I could have done both things with the "reading a command" activity, so the documentation should mention that as another alternative. I still don't think that check rules and the "reading a command" activity together cover all the usages that being able to actually use parsed values in the when clause would.

curiousdannii-testing commented 2 years ago

61eedb62875fc10070240916:

Too complex to solve at this time, and behaves according to specifications.