Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000453Core InformActivitiespublic2010-12-05 02:542014-05-07 07:33
ReporterPhonatacid 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000453: Activities on values do not work like activities on objects
DescriptionWhen passing an object to an activity on objects, the best fitting for rule is chosen on the basis of the kind of this object.
This mechanism doesn't work when the activity is an activity on values : Values, unlike objects, do not embed in their structure the informations concerning their kind. Thus, it is not possible to use activities on values, and write separate rules for each kind of value (number, text, etc...) although it is possible to create them.
Minimal Source Text To Reproduce
There is a room.

Enunciating something is an activity on values.

[Rule for enunciating a value (called T):
	if T is a text:
		say "it's a text[line break]";
	if T is an indexed text:
		say "it's an indexed text[line break]";
	if T is a number:
		say "it's a number[line break]";]
		
Rule for enunciating a text:
	say "TEXT";
	
Rule for enunciating a number:
	say "NUMBER";
		
When play begins:
	carry out the enunciating activity with "TEST";
	carry out the enunciating activity with 99;
Additional InformationThe commented part is here just to confirm the bug occurs on the "value level" and that it doesn't only concern the way the activity's for rule is chosen. Consequently, this bug should appear with "rules on values" or "actions applying to one value" (if this is possible).

I know this is rather a problem of language design, and that a feature that'd allow a value's kind to be identified at the i6 level has been asked in the context of dynamic object creation, but i thought it was important to point out this inconsistency :

Writing "X something is an activity on values" is currently not really useful.





EDIT: another bug that i think is related
###############################
There is a room.

Enunciating something is an activity on arithmetic values.

When play begins:
carry out the enonciating activity with 1;
################################
Problem. You wrote 'carry out the enonciating activity with 1' , but 'enonciating' has the wrong kind of value: an activity on arithmetic values rather than an activity on values.
################################

Yet it is possible to write: "Enonciating something is an activity on arithmetic values."
TagsNo tags attached.
Effect(mild) Compiler accepts invalid code
Attached Files

- Relationships
related to 0000648closedgraham Property names typecast to a number and back again can not be typed 

-  Notes
(0000882)
jmcgrew (administrator)
2010-12-05 03:37

I believe this code is invalid: "value" is not a specific enough type to use in constructing another type.
(0000889)
Phonatacid (reporter)
2010-12-06 06:20

Are you sure ?

##########################
There is a room.

To test_say (V - value):
say V;

John is a man

When play begins:
test_say "text[line break]";
test_say John;
##############################
text
John
Welcome
An Interactive Fiction
Release 1 / Serial number...
(0000890)
jmcgrew (administrator)
2010-12-06 09:01

Yes, you can use "value" in a phrase definition, as described in WI 21.6 ("Generic phrases"), because these are specialized at compile time. Every time you invoke the phrase with a different kind of value, Inform compiles another version of the phrase for that type. The type information is built into the generated code.

But to use "value" as part of the type of a variable (or a rule parameter), Inform would have to be able to identify the type of the value at runtime, which it currently has no means for doing.
(0002377)
graham (administrator)
2014-01-25 16:53

Yes, Inform should have rejected this with a problem message, and it now does.

- Issue History
Date Modified Username Field Change
2010-12-05 02:54 Phonatacid New Issue
2010-12-05 03:37 jmcgrew Effect (serious/mild) Game compiles but misbehaves => (mild) Compiler accepts invalid code
2010-12-05 03:37 jmcgrew Note Added: 0000882
2010-12-05 03:37 jmcgrew Status new => confirmed
2010-12-06 06:20 Phonatacid Note Added: 0000889
2010-12-06 09:01 jmcgrew Note Added: 0000890
2011-05-24 10:53 EmacsUser Relationship added related to 0000648
2014-01-25 16:53 graham Note Added: 0002377
2014-01-25 16:53 graham Status confirmed => resolved
2014-01-25 16:53 graham Resolution open => fixed
2014-01-25 16:53 graham Assigned To => graham
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