|View Issue Details [ Jump to Notes ] ||[ Issue History ] [ Print ] |
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002050||Core Inform||Relations||public||2018-02-06 00:44||2018-02-06 00:44|
|Assigned To|| |
|Priority||normal||Severity||mild||Reproducibility||have not tried|
|Product Version||6M62|| |
|Target Version||Fixed in Version|| |
|Summary||0002050: You can compare descriptions for equality, but there is no correct way to do that.|
|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).|
|Minimal Source Text 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?
|Tags||No tags attached.|
|Effect||(mild) Compiler accepts invalid code|