code-examples/2015/2015_03/ada/algorytmy/poles.adb

30 lines
651 B
Ada
Raw Normal View History

2025-03-09 10:58:55 +00:00
package body poles is
function get_pesel(This: pole) return su.Unbounded_String is
begin
return This.pesel;
end get_pesel;
procedure set_pesel(This: out pole; val: su.Unbounded_String) is
begin
This.pesel := val;
end set_pesel;
procedure greet(This: pole) is
name: su.Unbounded_String := This.get_name;
begin
if This in person'Class then
to.Put_Line("Person'Clas type");
end if;
if This in pole then
to.Put_Line("Pole type");
end if;
to.Put("Greets from pole ");
to.Put_Line(su.To_String(name));
end;
end poles;