Function composition: Difference between revisions

m (The Nim types were wrong, such that both f() and g() had to have identical input and return types, while in the update, you could have f() take an int, return a string, while g() takes in a string and returns an int.)
Line 2,801:
</pre>
 
=={{header|RPL}}==
RPL allows x to be a value or a variable. In this case, the function returns an expression.
{{works with|Halcyon Calc|4.2.7}}
≪ SWAP EVAL SWAP EVAL ≫
'FCOMP' STO
≪ ALOG ≫ ≪ COS ≫ 0 FCOMP
≪ ALOG ≫ ≪ COS ≫ 'x' FCOMP
{{out}}
<pre>
2: 10
1: 'ALOG(COS(x))'
</pre>
=={{header|Ruby}}==
This <tt>compose</tt> method gets passed two Method objects or Proc objects
1,150

edits