Function composition: Difference between revisions

Content deleted Content added
Aerobar (talk | contribs)
→‎{{header|RPL}}: actually composes 2 functions - previous version only evaluated them one after the other
PureFox (talk | contribs)
m →‎{{header|Wren}}: Changed to Wren S/H
Line 3,388: Line 3,388:


=={{header|Wren}}==
=={{header|Wren}}==
<syntaxhighlight lang="ecmascript">var compose = Fn.new { |f, g| Fn.new { |x| f.call(g.call(x)) } }
<syntaxhighlight lang="wren">var compose = Fn.new { |f, g| Fn.new { |x| f.call(g.call(x)) } }


var double = Fn.new { |x| 2 * x }
var double = Fn.new { |x| 2 * x }