Catamorphism: Difference between revisions
Add Refal
imported>Tromp |
Not a robot (talk | contribs) (Add Refal) |
||
Line 2,515:
say reduce &infix:<max>, @list;
say reduce &infix:<lcm>, @list;</syntaxhighlight>
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
, 1 2 3 4 5 6 7: e.List
= <Prout <Reduce Add e.List>>
<Prout <Reduce Mul e.List>>;
};
Reduce {
s.F t.I = t.I;
s.F t.I t.J e.X = <Reduce s.F <Mu s.F t.I t.J> e.X>;
};</syntaxhighlight>
{{out}}
<pre>28
5040</pre>
=={{header|REXX}}==
This REXX example is modeled after the Raku example (it is NOT a translation).
Line 2,572 ⟶ 2,587:
LCM: 2520
</pre>
=={{header|Ring}}==
<syntaxhighlight lang="ring">
|