!ASIS Issue #079 !topic Corresponding_Called_Entity and stream oriented attribute references !reference ASIS 95-18.25 and 17.29 !from Alain Le Guennec 97-04-25 !keywords Corresponding_Called_Entity, Corresponding_Called_Function, stream attribute references !discussion As currently specified, Corresponding_Called_Entity and Corresponding_Called_Function have to return a Nil_Element for a prefix that denotes an attribute reference. I think there is a case in Ada95 where these queries could yield a more usefull result, namely for stream oriented attributes which have an attribute representation clause. Please consider the following example: ------------------------------------- with Ada.Streams; procedure Sample32 is package My_Package is type TR is null record; procedure Write_TR (Stream : access Ada.Streams.Root_Stream_Type'Class; Item : in TR); for TR'Write use Write_TR; end My_Package; package body My_Package is procedure Write_TR (Stream : access Ada.Streams.Root_Stream_Type'Class; Item : in TR) is begin null; end Write_TR; end My_Package; use My_Package; type SA is access Ada.Streams.Root_Stream_Type'Class; R : TR; S : SA; begin TR'Write (S, R); end Sample32; It is determined statically that this call is actually pointing to My_Package.Write_TR, so why not return this subprogram declaration instead of a Nil_Element ? Any comment ? !resolution Accept, with Modification. !date 97-05-28 !Notes For 18.25, function Corresponding_Called_Entity, add the following paragraph to the commentary: -- If procedure_prefix denotes an attribute_reference, and if the -- corresponding attribute is (re)defined by an attribute definition clause, an -- implementation is encouraged, but not required, to return the definition of -- the corresponding subprogram whose name is used after "use" in this -- attribute definition clause. If an implementation cannot return such a -- subprogram definition, a Nil_Element should be returned. For an attribute -- reference which is not (re)defined by attribute definition clause, a -- Nil_Element should be returned. For 17.29, function Corresponding_Called_Function, add the following paragraph to the commentary: -- If function_prefix denotes an attribute_reference, and if the -- corresponding attribute is (re)defined by an attribute definition clause, an -- implementation is encouraged, but not required, to return the definition of -- the corresponding subprogram whose name is used after "use" in this -- attribute definition clause. If an implementation cannot return such a -- subprogram definition, a Nil_Element should be returned. For an attribute -- reference which is not (re)defined by attribute definition clause, a -- Nil_Element should be returned. Changes were made to ASIS version 2.0.N.