Skip to content

Commit

Permalink
Fix for Mantis bug 1946
Browse files Browse the repository at this point in the history
  • Loading branch information
ganelson committed Apr 11, 2022
1 parent ea328f3 commit d4122ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
22 changes: 11 additions & 11 deletions inform7/Tests/Test Problems/_Results_Ideal/PM_BadRepeatDomain.txt
@@ -1,13 +1,13 @@
Inform 7 build 6L48 has started.
Inform 7 v10.1.0 has started.
I've now read your source text, which is 15 words long.
I've also read Standard Rules by Graham Nelson, which is 42569 words long.
I've also read English Language by Graham Nelson, which is 2288 words long.
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
I've also read Standard Rules by Graham Nelson, which is 32092 words long.
Problem__ PM_BadRepeatDomain
>--> You wrote 'repeat with X running through numbers' (source text, line 4):
but this describes a collection of values which can't be repeated through,
because the possible range is too large (or has no sensible ordering). For
instance, you can 'repeat with D running through doors' because there are
only a small number of doors and they can be put in order of creation. But
you can't 'repeat with N running through numbers' because numbers are
without end.
Inform 7 has finished: 50 centiseconds used.
>--> In 'repeat with X running through numbers' (source text, line 4), you
seem to want to repeat through all possible values which have the kind 'a
number', and there are just too many of those. For instance, you can
'repeat with D running through doors' because there are only a small number
of doors, but you can't 'repeat with N running through numbers' because
numbers are without end.
Inform 7 has finished.
15 changes: 9 additions & 6 deletions inform7/imperative-module/Chapter 4/Compile Loops.w
Expand Up @@ -148,13 +148,16 @@ We can optimise out the "if" part in the case when $\phi(x) = {\it kind}_K(x)$.
"but this is not allowed. (Sorry: it's too hard to get right.)");

@<Issue bad repeat domain problem@> =
StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_BadRepeatDomain),
"this describes a collection of values which can't be repeated through",
"because the possible range is too large (or has no sensible ordering). "
Problems::quote_source(1, current_sentence);
Problems::quote_kind(2, K);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_BadRepeatDomain));
Problems::issue_problem_segment(
"In %1, you seem to want to repeat through all possible values which have "
"the kind '%2', and there are just too many of those. "
"For instance, you can 'repeat with D running through doors' because "
"there are only a small number of doors and they can be put in order "
"of creation. But you can't 'repeat with N running through numbers' "
"because numbers are without end.");
"there are only a small number of doors, but you can't 'repeat with N "
"running through numbers' because numbers are without end.");
Problems::issue_problem_end();

@ Here we compile code to call |D(v)|, on the variable |fromv|, or |D(0)| if
|fromv| is |NULL|. As in //Deciding to Defer//, we are forced to call |D| as
Expand Down

0 comments on commit d4122ee

Please sign in to comment.