MPS issue job003325

TitlePurpose of the "class" method of an object format is unclear
Statusopen
Prioritynice
Assigned userRichard Brooksby
OrganizationRavenbrook
DescriptionObject formats of variant B can specify a "class" method. It is not clear what this is for, or why it is only useful for formats of variant B and not, say, variant auto_header.
AnalysisThe documentation [1] has a couple of use cases for the class method:

(a) "A class method returns an address that is related to the class of the object, for passing on to various support tools (such as graphical browsers)."

(b) "These may be associated with strings via mps_telemetry_intern and mps_telemetry_label."

For use case (a), why does it need a slot in the object format?

Use case (b) would seem reasonable if it resulted in useful stuff in the event stream, but looking through the code, the only place where format->class is actually called is in BufferTrip in buffer.c [2] and then only for BufferModeLOGGED (for which there's no public interface for turning on). So this isn't a use case I can document.

So for the moment I have removed everything that I don't understand about the class method from the documentation for mps_fmt_class_t and mps_fmt_B_s. If someone can explain the supported use cases to me I will be happy to write them up and add them.
How foundinspection
Evidence[1] <http://info.ravenbrook.com/project/mps/master/manual/reference/#mps_fmt_class_t>
[2] <http://info.ravenbrook.com/project/mps/master/code/buffer.c>
Observed in1.110.0
Created byGareth Rees
Created on2012-10-19 13:40:12
Last modified byGareth Rees
Last modified on2012-10-19 14:04:27
History2012-10-19 GDR Created.