Anonymous user
Partial function application: Difference between revisions
m
→{{header|Elena}}
m (grammar) |
|||
Line 631:
=={{header|Elena}}==
{{trans|Smalltalk}}
ELENA 3.
<lang elena>import system'collections.
import system'routines.
import extensions.
[
var partial := (:afs:af)((:s)(afs
var fs := (:f:s)(s selectBy(:x)(f(x)); summarize(ArrayList new); toArray).
Line 647:
var fsf2 := partial(fs, f2).
console printLine(fsf1((2,4,6,8)) toLiteral).
console printLine(fsf2((2,4,6,8)) toLiteral).
]
{{out}}
<pre>
|