Anonymous user
First-class functions: Difference between revisions
→Tacit (unorthodox) version
Line 1,400:
<lang j> train =. (<'`:')(0:`)(,^:)&6 NB. Producing the function train corresponding to the functional `:6
inverse=. (<'^:')(0:`)(,^:)&_1 NB. Producing the function inverse corresponding to the functional ^:_1
an =. <@:((,'0') ; ]) NB. Producing the atomic representation of a noun
of =. train@:([ ; an) NB. Evaluating a function for an argument
Line 1,413:
│1&o.^:_1│2&o.^:_1│^&3^:_1│
└────────┴────────┴───────┘
]BA=. B
┌────────────────┬────────────────┬──────────────┐
│1&o.^:_1@:(1&o.)│2&o.^:_1@:(2&o.)│^&3^:_1@:(^&3)│
└────────────────┴────────────────┴──────────────┘
BA of &> 0.5 NB. Evaluating the compositions at 0.5
0.5 0.5 0.5
</lang>
=={{header|Java}}==
|