If you declare INT
as a Integer, it will always be a Integer in that scope.
So you could just make a function like:
function the_type(I : Integer) return String is ("Integer");
I can't think of a reason you would want to check the type of variable INT
if it always going to be a Integer.
On the other hand if INT
can change type at run-time you will need code to emulate that:
procedure Main is
type Memory_Type_Enum is (Integer_Type, Float_Type);
record Variable
Memory_Location : Address;
Memory_Type : Memory_Type_Enum;
end record;
INT : Variable;
begin
INT := Allocate_Variable(Float_Type);
INT := Allocate_Variable(Integer_Type);
Put_Line(INT.Memory_Type'Img);
end;
But it's up to you how you implement a type check whether you have dynamic type system or static.