Top Up Prev Next Bottom Contents Index Search

4.3 Higher-Order Functions (HOF)

A function is higher-order if it takes a function as an argument and/or returns a function. A classic example is mapcar in Lisp, which takes two arguments, a function and a list. Its behavior is to apply the function to each element of the list and to return a list of the results. The HOF domain implements a similar function, in the form of a star called Map, that can apply any other star (or galaxy) to the sequence(s) at its inputs. Many other useful higher-order functions are also provided by this domain.

The HOF domain provides a collection of stars designed to be usable in all other Ptolemy domains. It is intended to be included as a subdomain by all other domains.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.