tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,37 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const func type: container (in type: elemType) is func
|
||||
result
|
||||
var type: container is void;
|
||||
begin
|
||||
container := array elemType;
|
||||
|
||||
global
|
||||
|
||||
const func container: map (in container: aContainer,
|
||||
inout elemType: aVariable, ref func elemType: aFunc) is func
|
||||
result
|
||||
var container: mapResult is container.value;
|
||||
begin
|
||||
for aVariable range aContainer do
|
||||
mapResult &:= aFunc;
|
||||
end for;
|
||||
end func;
|
||||
|
||||
end global;
|
||||
end func;
|
||||
|
||||
const type: intContainer is container(integer);
|
||||
var intContainer: container1 is [] (1, 2, 4, 6, 10, 12, 16, 18, 22);
|
||||
var intContainer: container2 is 0 times 0;
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var integer: num is 0;
|
||||
begin
|
||||
container2 := map(container1, num, num + 1);
|
||||
for num range container2 do
|
||||
write(num <& " ");
|
||||
end for;
|
||||
writeln;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue