Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000759Core InformRules and rulebookspublic2011-09-28 19:392014-05-07 07:34
ReporterRon Newcomb 
Assigned Tograham 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionfixed 
PlatformPPCOSMac OS XOS Version10.4
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000759: can't follow/consider some rulebooks
DescriptionThe below source gives me the problem message, "but 'after reading a command rules' has the wrong kind of value: a rulebook rather than a rule."

Of course, Consider and Follow can both be used on rules and rulebooks. "consider the when play begins rules" works just fine, and "consider the scene changing rules" is part of the Standard Rules. So not only is the problem message misleading, but I'm unsure why it appears to begin with.

Minimal Source Text To Reproduce
When play begins, consider the after reading a command rules.
TagsNo tags attached.
Effect(serious) Compiler rejects valid code
Attached Files

- Relationships
related to 0001095closedgraham No phrase to get value produced by a nothing based rule 

-  Notes
(0001298)
zarf (developer)
2011-09-29 09:01

Yeah, this is weird. In the following code:

let Y be when play begins;
let X be after reading a command;
consider Y;
[consider X;]

...it looks like X and Y should be the same type; they're even noted that way in the generated I6 code.

    t_0 ! Local variable e.g. 'Y' = rulebook
    t_1 ! Local variable e.g. 'X' = rulebook

But "consider Y" is legal, whereas "consider X" throws an error. ("X = a temporary named value, holding a rulebook")
(0001299)
EmacsUser (manager)
2011-09-29 14:22

Confirmed. The after reading a command rulebook is a nothing-based rulebook, but follow, consider, and abide expect action-based rulebooks when a basis isn't given. The error messages are unhelpful because of 0000750.

I don't see any way to consider a nothing-based rulebook with the standard rules as they currently stand. You can add lines like

- - - -
To consider (RL - a nothing based rule) (documented at ph_consider): (- ProcessRulebook({RL},0,true); -).
- - - -

as a workaround.
(0001300)
Ron Newcomb (reporter)
2011-09-29 14:56

Ah. OK, since the Standard Rules have

   To follow (RL - a rule)
   To follow (RL - value of kind K based rule producing a value) for (V - K)

it seems that the first one just needs changing to

To follow (RL - a nothing based rule producing a value)

Since the ResultOfRule phrases fetch any returned value. And similarly for Consider, yes? Or does that change no longer accept rules that produce nothing, so a 3rd phrase really is needed?

Thanks EmacsUser.
(0001301)
EmacsUser (manager)
2011-09-29 20:35

Because it used to be that all rules were action-based,

- - - -
To follow (RL - a rule): ...
- - - -

is shorthand for

- - - -
To follow (RL - an action based rule): ...
- - - -

making it the only line to match code like ``follow the when play begins rulebook.'' So we do need three phrases. On the other hand, we get by without special phrases for rules that produce nothing because ``value of kind K based rule producing a value'' matches (perhaps surprisingly) even rules producing the void kind.
(0002004)
zarf (developer)
2013-04-04 11:45

See also 0001095, which is the same problem for the "(name of kind K) produced by (RL - rule producing a value of kind K)" phrase.
(0002273)
graham (administrator)
2014-01-12 07:08

Fixed; see 0001095.

- Issue History
Date Modified Username Field Change
2011-09-28 19:39 Ron Newcomb New Issue
2011-09-29 09:01 zarf Note Added: 0001298
2011-09-29 14:22 EmacsUser Note Added: 0001299
2011-09-29 14:22 EmacsUser Severity mild => serious
2011-09-29 14:22 EmacsUser Status new => confirmed
2011-09-29 14:56 Ron Newcomb Note Added: 0001300
2011-09-29 20:35 EmacsUser Note Added: 0001301
2013-04-04 09:46 EmacsUser Relationship added related to 0001095
2013-04-04 11:45 zarf Note Added: 0002004
2014-01-12 07:08 graham Note Added: 0002273
2014-01-12 07:08 graham Status confirmed => resolved
2014-01-12 07:08 graham Resolution open => fixed
2014-01-12 07:08 graham Assigned To => graham
2014-05-07 07:34 jmcgrew Fixed in Version => 6L02
2014-05-07 07:34 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker