Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000830Core InformPhrases and functional programmingpublic2012-01-02 09:322014-05-07 07:33
ReporterEmacsUser 
Assigned Tograham 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000830: Error message for untestable condition in dynamic dispatch points to the call site, not the condition
DescriptionThe attached source leads to

- - - -
Problem. You wrote 'dispatch based on five' : but this is not a condition I am able to test, or at any rate not during play.
- - - -

when the trouble is the author writing ``a number that is even'' instead of ``an even number.''
Minimal Source Text To Reproduce
There is a room.
To dispatch based on (X - a number that is even): do nothing.
When play begins:
	dispatch based on five.
Additional InformationThere is probably another bug here: either that ``a number that is even'' should be accepted, or else that ``a number that is even'' should raise a problem message even when the when-play-begins rule is left out.
TagsNo tags attached.
Effect(cosmetic) Error message is badly worded
Attached Files

- Relationships

-  Notes
(0001690)
curiousdannii (developer)
2012-06-20 08:38

I think the error message is appropriate. It really is a problem with the call, not the phrase. Suppose you had the following; which phrase would be the source of the problem? I would say none, the source is the call.

- - - -
There is a room.
To dispatch based on (X - a number that is even): do nothing.
To dispatch based on (X - a thing): do nothing.
To dispatch based on (X - a door): do nothing.
To dispatch based on (X - a direction): do nothing.
When play begins: dispatch based on five.
- - - -

I agree that "a number that is even" should work.

Bonus bug: two error messages for the following!

- - - -
There is a room.
To dispatch based on (X - a number that is even): do nothing.
To dispatch based on (X - a number that is odd): do nothing.
To dispatch based on (X - an odd number): do nothing.
When play begins: dispatch based on five.
- - - -
(0001692)
EmacsUser (manager)
2012-06-20 19:45
edited on: 2012-06-20 19:46

> Which phrase would be the source of the problem?

- - - -
To dispatch based on (X - a number that is even): do nothing.
- - - -

I would argue, because that's the line that the author has to change to make the code compile. And also because these things internally become a chain of ifs, like

- - - -
When play begins:
    if five is a number that is even:
        do nothing; [call to implementation 0 goes here]
    otherwise if five is a number that is odd:
        do nothing; [call to implementation 1 goes here]
    otherwise:
        do nothing. [raise a runtime problem here]
- - - -

so that the problems are detected at the granularity not of entire call lines, but of individual ifs---ifs whose code comes mainly from the callees.

(Provided, as I'm pretty sure is true, the value being tested can't affect the testability of the condition, one could contend that the problem messages shouldn't even mention the call site, but should occur once per troublesome callee whatever the call site count.)

Thanks for the confirms, by the way.

(0001698)
curiousdannii (developer)
2012-06-21 08:56

I don't know what to think about these dispatch errors, other than that they need to be improved. Graham will have ideas I'm sure.

And no worries. I wrote in the forum a few days ago how most bugs get confirmed by you, so I thought I'd check on the outstanding new bugs, and sure enough, most were reported by you!
(0002000)
jmcgrew (administrator)
2013-03-30 04:02

"A number that is greater than 5" compiles, so I'd expect "a number that is even" to work as well.
(0002350)
graham (administrator)
2014-01-25 02:41

The source text is correct, so the problem message should never be issued; this is now fixed. (A run-time problem does appear, but rightly, since 5 is odd.)

- Issue History
Date Modified Username Field Change
2012-01-02 09:32 EmacsUser New Issue
2012-06-20 08:38 curiousdannii Note Added: 0001690
2012-06-20 08:38 curiousdannii Status new => feedback
2012-06-20 19:45 EmacsUser Note Added: 0001692
2012-06-20 19:45 EmacsUser Status feedback => new
2012-06-20 19:46 EmacsUser Note Edited: 0001692 View Revisions
2012-06-20 19:46 EmacsUser Note Edited: 0001692 View Revisions
2012-06-21 08:56 curiousdannii Note Added: 0001698
2013-03-30 04:02 jmcgrew Note Added: 0002000
2013-03-30 04:02 jmcgrew Status new => confirmed
2014-01-25 02:41 graham Note Added: 0002350
2014-01-25 02:41 graham Status confirmed => resolved
2014-01-25 02:41 graham Resolution open => fixed
2014-01-25 02:41 graham Assigned To => graham
2014-01-25 02:42 graham Severity cosmetic => serious
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker