curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-2014] [Mantis 2050] You can compare descriptions for equality, but there is no correct way to do that. #70

Open curiousdannii-testing opened 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : NYKevin

Description :

The attached code prints false instead of true. However, there is no general way to get this comparison right, so it should probably be disallowed entirely (or alternatively, WI might grow a paragraph about "object identity vs. object equivalence" in the Advanced Phrases section).

Steps to reproduce :

The Cave is a room.

Frobozz Magic Description Company Catalog relates one description of numbers to one number.

The verb to be available on page implies the Frobozz Magic Description Company Catalog relation.

To decide what description of Ks is cast (D - a description of values of kind K) to value:
    Decide on D;

When play begins:
    Now cast even numbers to value is available on page 2;
    Showme whether or not cast even numbers to value is available on page 2;

Additional information :

The descriptions stored in this relation are otherwise fully functional, aside from not printing very usefully e.g. in RELATIONS output. This particular case could be solved by interning or constant folding the description literal, though I'm uncertain whether it's worth it in the general case.

It is not possible to get this comparison right because descriptions can be arbitrarily complicated. You could ask whether "numbers which are counterexamples to the Goldbach conjecture" is equal to an empty description, for example. This particular case could be solved by interning or constant-folding the literal, but that's not going to work in the general case.

Finally, you can still retrieve the contents of this relation by using the phrase "list of descriptions of numbers that relate to N by the Frobozz Magic Description Company Catalog relation", so disallowing this won't actually break anything.

Side note: Why is "cast [description] to value" not already in the standard rules, given how easy it is to write and how many things break without it?

imported from: [Mantis 2050] You can compare descriptions for equality, but there is no correct way to do that.
  • status: Reported
  • resolution: Open
  • resolved: 2022-04-07T05:02:33+10:00
  • imported: 2022/01/10