Nested templated data: Difference between revisions

Add Refal
(Added various BASIC dialects (Applesoft BASIC, BASIC256, Chipmunk Basic,FreeBASIC, GW-BASIC, MSX Basic, QBasic, QB64, Run BASIC and Yabasic))
(Add Refal)
Line 1,574:
Data structure: ((("Payload#1", "Payload#2"), (Any, "Payload#4", "Payload#1"), "Payload#5"),)</pre>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
, (((1 2) (3 4 1) 5)): e.Template
, "Payload#0" "Payload#1" "Payload#2" "Payload#3"
"Payload#4" "Payload#5" "Payload#6": e.Payload
= <Prout <Subst (e.Payload) e.Template>>;
};
 
Subst {
(e.P) = ;
(e.P) s.I e.X = <Item s.I e.P> <Subst (e.P) e.X>;
(e.P) (e.X) e.Y = (<Subst (e.P) e.X>) <Subst (e.P) e.Y>;
};
 
Item {
0 t.I e.X = t.I;
s.N t.I e.X = <Item <- s.N 1> e.X>;
};</syntaxhighlight>
{{out}}
<pre>(((Payload#1 Payload#2 )(Payload#3 Payload#4 Payload#1 )Payload#5 ))</pre>
=={{header|REXX}}==
===version 1===
2,115

edits