FunctionClosures

This page contains an applet that should appear as a separate window.

This model demonstrates the interoperability of CAL functions and Ptolemy functions. The Fac actor creates a simple CAL function, which is applied in the Apply expression actor. Conversely, the ApplyF CAL actor takes a Ptolemy expression language function as argument and uses it inside the CAL code as if it was a CAL function. In fact, CAL functions are represented as Ptolemy FunctionTokens, and as a consequence virtually indistinguishable from functions generated by the Ptolemy expression language. This means that all the CAL facilities become immediately available in Ptolemy, such as recursion and mutually recursive functions.

\ \ MoML specification for this model. \