The practical power of a software system is largely a function of the freedom with which a basis set of pre-existing functions can be combined to span a combinatorial space of possible computations: The search for increased programming power has driven a relentless trend toward ever more flexible ways of combining ever shorter functions, currently reaching some sort of apogee in the functional programming community.
A natural result of this trend to shorter functions used as building blocks in large computations is that many functions are created simply to be immediately passed to other functions. Requiring that such functions be given names only contributes to syntantic clutter.
The Muq MUF syntax for declaring an anonymous function is identical to that for a named function, except that a double colon replaces the single colon, the name is dropped, and the compiled function is left on the stack:
Stack: :: "Hi mom!\n" , ; Stack: <c-fn _> call Hi mom! Stack:
Note: This example also doesn't work quite right on Muq version -1.0.0. Thpt!
Go to the first, previous, next, last section, table of contents.