Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Function-composition/Ada/function-composition-2.ada
Normal file
25
Task/Function-composition/Ada/function-composition-2.ada
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package body Functions is
|
||||
function "*" (Left : Func; Right : Argument) return Argument is
|
||||
Result : Argument := Right;
|
||||
begin
|
||||
for I in reverse Left'Range loop
|
||||
Result := Left (I) (Result);
|
||||
end loop;
|
||||
return Result;
|
||||
end "*";
|
||||
|
||||
function "*" (Left, Right : Func) return Func is
|
||||
begin
|
||||
return Left & Right;
|
||||
end "*";
|
||||
|
||||
function "*" (Left : Func; Right : Primitive_Operation) return Func is
|
||||
begin
|
||||
return Left & (1 => Right);
|
||||
end "*";
|
||||
|
||||
function "*" (Left, Right : Primitive_Operation) return Func is
|
||||
begin
|
||||
return (Left, Right);
|
||||
end "*";
|
||||
end Functions;
|
||||
Loading…
Add table
Add a link
Reference in a new issue