I suggest you ...

(Syntax) Flag "the <kind>" as an error

New authors frequently seem to write things like "instead of going to a room when the room is not visited", intending "the room" to mean some particular room, but I7 treats it the same as "a room" and produces unexpected behavior. The syntax should just be rejected at compile time, since it never means what anyone expects it to mean.

9 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jesse McGrewJesse McGrew shared this idea  ·   ·  Admin →
    declined  ·  emshortAdminemshort (Admin, Inform 7) responded  · 

    I’m closing this out only because it is also in Mantis, but it’s not an actual decline, just a removal of duplication.

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Andrew PlotkinAndrew Plotkin commented  · 

        (After this has come up on the forum for the fiftieth time...) Once the compiler is distinguishing "a room" from "the room", it shouldn't be *too* hard to accept "the room" in certain circumstances.

        (Ron Newcomb suggests something like this in http://inform7.uservoice.com/forums/57320-general/suggestions/1357393-more-thoroughly-highlight-the-way-inform-understan , but it fits here.)

        Roughly: if a code block has "a <kind>" or "some <kind>" as a condition, treat that as a selector and accept "the <kind>" within that block only.

        if the player has a match: now the match is lit.

        This would be equivalent to:

        if the player has a match (called M): now M is lit.

        If "the <kind>" occurs *not* in such a block, generate an explicit problem message.

      • Andrew PlotkinAndrew Plotkin commented  · 

        Small complication: there are a few cases where "the KIND" or "the ... KIND" is legitimate and handled correctly. "all of the doors", "the largest container"

        There's also the suggestion entry "get rid of 'a random'..." which would legitimize "the container carried by the player" if there were only one such.

      Feedback and Knowledge Base