First-class functions: Difference between revisions

Line 1,396:
 
===Tacit (unorthodox) version===
In J only adverbs and conjunctions (functionals) can produce verbs (functions)... Unless they are forced to cloak as verbs (functions). (Note that this takes advantage of a bug/feature of the interpreter ; see [http://rosettacode.org/wiki/Closures/Value_capture#Tacit_.28unorthodox.29_version unorthodox tacit] .) The resulting functions (which correspond to functionals) can take and produce functions:
 
<lang j> train =. (<'`:')(0:`)(,^:)&6 NB. Producing the function train corresponding to the functional `:6
Anonymous user