Function composition: Difference between revisions
→{{header|RPL}}: actually composes 2 functions - previous version only evaluated them one after the other
(→{{header|RPL}}: actually composes 2 functions - previous version only evaluated them one after the other) |
|||
Line 2,869:
=={{header|RPL}}==
« →STR SWAP →STR +
▲{{works with|Halcyon Calc|4.2.7}}
DUP "»«" POS " " REPL STR→
» '<span style="color:blue">FCOMP</span>' STO <span style="color:grey">@ ''( « f » « g » → « f o g » )''</span>
≪ ALOG ≫ ≪ COS ≫
≪ ALOG ≫ ≪ COS ≫
≪ ALOG ≫ ≪ COS ≫ <span style="color:blue">FCOMP</span> 'x' EVAL
{{out}}
<pre>
3: ≪ COS ALOG ≫
2: 10
1: 'ALOG(COS(x))'
</pre>
=={{header|Ruby}}==
This <tt>compose</tt> method gets passed two Method objects or Proc objects
|