Callable

Revision as of 15:06, 20 August 2025 by Lchrisman (talk | contribs) (Created page with "category:Python integration ''new to Analytica 7.0'' == Callable class == A Callable Object is a Variable subclass. Like a Variable, it has a Evaluation mo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

new to Analytica 7.0

Callable class

A Callable Object is a Variable subclass. Like a Variable, it has a mid-value and a sample-value that are computed by evaluating its Definition.

The result of a Callable is expected to be a value that is itself callable with parameters. For example, its value might be a local function, a handle to an Analytica function, a python function, a python class, or even an array of these.

In other words, the Callable instance is a type of Variable, but its value is a function-like instance.

The Callable class provides two advantages over a Variable class. First, it displays with a function-like shape on an influence diagram, which may better reflect the logical purpose of the node, and second, it allows you to use a X(a,b,c) syntax to call it instead of the X->(a,b,c) syntax that would be required with a normal Variable. This is most useful when intermixing Python code. For example, when a Callable object's definition is set to be a Python expression that contains a function def or a class declaration.

See also

Comments


You are not allowed to post comments.