Anonymous user
First-class functions: Difference between revisions
added Ursala
m (→{{header|AutoHotkey}}: Minor indentation and casing edit) |
(added Ursala) |
||
Line 459:
{{omit from|Make}}
{{omit from|PlainTeX}}
=={{header|Ursala}}==
Zip two lists of functions into a list of pairs of functions, make
that a list of functions by composing each pair, "gang" the list of
functions into a single function returning a list, and apply it to the
argument 0.5.
<lang Ursala>#import std
#import flo
functions = <sin,cos,times^/~& sqr>
inverses = <asin,acos,math..cbrt>
#cast %eL
main = (gang (+)*p\functions inverses) 0.5</lang>
output:
<pre><5.000000e-01,5.000000e-01,5.000000e-01></pre>
|