Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
21
Task/Nested-templated-data/SETL/nested-templated-data.setl
Normal file
21
Task/Nested-templated-data/SETL/nested-templated-data.setl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
program substitution;
|
||||
template := [[[1,2],[3,4,1],5]];
|
||||
payload := {
|
||||
[0,"Payload#0"], [1,"Payload#1"], [2,"Payload#2"], [3,"Payload#3"],
|
||||
[4,"Payload#4"], [5,"Payload#5"], [6,"Payload#6"]
|
||||
};
|
||||
|
||||
print(subst(template, payload));
|
||||
|
||||
proc subst(template, payload);
|
||||
if not is_tuple(template) then
|
||||
return(payload(template));
|
||||
end if;
|
||||
|
||||
result := [];
|
||||
loop for item in template do
|
||||
result with:= subst(item, payload);
|
||||
end loop;
|
||||
return result;
|
||||
end proc;
|
||||
end program;
|
||||
Loading…
Add table
Add a link
Reference in a new issue