, , . , , .
:
q ( );
q ( );
q - (is -);
q - (part of-).
- :
1) ;
2) ;
3) ;
4) ;
5) ;
6) ;
7) .
, . , . . -.
-. . . .
-, .
, , , , .
-. , Ada 95, C++, .
SmallTalk CLOS. , , .
, - -. , . -.
.
: . , . .
. 9.10.
. 9.10. , :
q , ;
q .
--. . .
. . , . , , ( ).
|
|
--, , , 0 , . . :
q --;
q --;
q --.
. 9.11, :
q , ;
q , ;
q , ;
q , .
. 9.11.
, , ( ) ( ) .
(is ), . , ( ).
: , . , .
with...;...
use...;...
Package _ is
type is tagged private;
function return ;
procedure (the: in out );
function (the: )
return ;
private
type is tagged record
: integer;
: ;
end record;
end _;
:
with _;...
use _;...
Package _ is
type is new with private;
function (:; :;
:) return ;
procedure (the: in out );
function (the: ) return ;
private
type is new
with record
1: ;
2: ;
3:
end record;
end _;
, ( ), ( ) ( ).
, , . 9.12.
. 9.12.
() , , , , . , , , .
|
|
( ). .
.
procedure (the: in out ) is
begin
--
--
end ;
:
procedure (the: in out ) is
begin
( (the)); --
--
--
--
--
end ;
, :
: := ;
: := (768. 21. 20);
, :
procedure (d: in out
'class; t: ) is
begin
if (d) >= t then
(d): --
end if;
end ;
?
q (, (60));
q (, (120));
. . . , d , , .
.
:
with _. _;
use _, _;
Package _ is
type _ is access all ;
type is tagged private:
procedure (the: in out ;
yr: _);
function (the: ;
r: _) return ;
private
type is tagged record
: ;
end _;
, , . . , , . .
() . 9.13.
. 9.13. ()
. :
private
type _ is access all ;
type is tagged record
: _;
end _;
.
. .
() . 9.14. - - , ( ).
. 9.15, . ( . 9.15). (, ) . , , . .
|
|
: .
. 9.14.
. 9.15.
, ( ) ().
, , . 9.15, , () -. (, , ), , -. , .
, , () (), . , , . , , . .
, . ( Ada 95) . , . 9.16, .
. 9.16.
. ( ). , [22].
, , () , , , . () . . . .
-. Ada 95, -. generic , .
: () :
generic
type is private;
package _ is
type is limited tagged private;
procedure (_0: in out ;
: );
private
end _0;
. .
, - :
package _ is new _0
( => Integer);
package _ is new _0
( => );
Integer ( ), .
|
|
. , , .
. 9.17. , . , (-).
. 9.17.
1. - ?
2. - ?
3. - ?
4. - ?
5. - ? ?
6. .
7. ?
8. ?
9. ?
10. ?
11. ?
12. ?
13. ?
14. ?
15. .
16. .
17. ?
18. . ?
19. .
20. .
21. ?
22. ?
23. .
24. .
25. .
26. .
27. .
28. .
29. .