First-class functions/Use numbers analogously: Difference between revisions

m
(→‎{{header|Groovy}}: new solution)
Line 799:
=={{header|Oforth}}==
 
<lang Oforth>func: multiplier(n1, n2) { #[ n1 n2 * * ] }
 
func: firstClassNum
{
| x xi y yi z zi |
 
2.0 ->x
0.5 ->xi
Line 811 ⟶ 809:
x y + ->z
x y + inv ->zi
[ x, y, z ] [ xi, yi, zi ] zipWith(#multiplier) map(#[ 0.5 swap perform ] ) println. ;</lang>
}</lang>
{{out}}
<pre>
1,015

edits