Version 1.2 of ais/ai-00335.txt
!standard 13.13.02 (04) 03-07-30 AI95-00335/00
!class binding interpretation 03-07-30
!status received 03-04-23
!qualifier Omission
!priority Low
!difficulty Medium
!subject Stream attributes are [never] dispatching
!summary
!question
Are stream attributes of tagged types dispatching?
The stream attributes as applied to tagged types do not appear to be
treated as dispatching operations, since they don't fall into the
categorization of being primitive subprograms by the rules in 3.2.3.
However, the semantics of 'Class'Output is defined to make a dispatching
call to 'Output. Shouldn't a user-defined 'Class'Output be able to make the
same call?
!recommendation
!wording
!discussion
[I didn't write up this AI, as it is not clear whether these should (or should
not) be dispatching. Note that parts of 'Class'Input is magic, so it probably
doesn't matter if more if it is magic.]
!corrigendum 13.13.02(0x)
!ACATS test
An ACATS test should be constructed to test this rule.
!appendix
From: Gary Dismukes
Sent: Wednesday, February 12, 2003 1:12 PM
This is a quick question on stream attributes that arose
from a customer report.
According to my reading of the rules, the stream attributes
as applied to tagged types are not treated as dispatching
operations, since they don't fall into the categorization
of being primitive subprograms by the rules in 3.2.3.
Now the semantics of 'Class'Output are defined to involve
a dispatching call to 'Output. It seems that a user-written
version of 'Class'Output might also want to make dispatching
calls on 'Output, but that's not possible unless 'Output
is a dispatching operation.
So the question is, is it really intended that the 'Output and
'Input subprograms are not dispatching operations, or is there
some reading of the rules that permits dispatching calls to
these attributes?
****************************************************************
From: Tucker Taft
Sent: Wednesday, February 12, 2003 1:40 PM
It seems like we could relatively easily rule either way,
because the manual is not very clear about the intent.
I did check that our compiler allows passing a class-wide
object to T'Output, but does a statically bound call -- probably the
worst of both worlds!
****************************************************************
From: Gary Dismukes
Sent: Wednesday, February 12, 2003 3:12 PM
Interesting, our compiler exhibited that behavior as well :)
It would be useful to find out what some of the other compilers
do with such calls.
Btw, I managed to find one place in the AIs that alluded to the
nondispatching nature of stream attributes, in the famous AI-195
on misc. stream attribute issues. Under issue 5 (relating to
associating a stream attribute with an abstract operation) in the
!discussion section there's a statement:
5 - Obviously it should not be possible to perform a non-dispatching call to
an abstract subprogram (stream-oriented attributes are always called in a
non-dispatching manner). ...
So it looks like at least the person who wrote that (Pascal?) believed
that calls to stream attributes are supposed to be nondispatching.
****************************************************************
Questions? Ask the ACAA Technical Agent