Partial function application: Difference between revisions

m
m (grammar)
Line 631:
=={{header|Elena}}==
{{trans|Smalltalk}}
ELENA 3.34 :
<lang elena>import system'collections.
import system'routines.
import extensions.
programpublic =program
[
var partial := (:afs:af)((:s)(afs eval(af, s))).
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).
].</lang>
{{out}}
<pre>
Anonymous user