See Ptrees for an introduction.

The following symbols are exported by the lparallel.ptree package as well as by the convenience package lparallel.

[special variable]

When non-nil, `*kernel*’ is bound to this value during the call of a node function.

call-ptree id ptree

Return the computation result of the node with identifier `id’ in `ptree’.

If the node is uncomputed, compute the result.

If the node is already computed, return the computed result.

check-ptree ptree

Verify that all nodes have been defined with an associated function. If not, `ptree-undefined-function-error’ is signaled.

clear-ptree ptree

Clear all node results in `ptree’, restoring the tree to its uncomputed state.

clear-ptree-errors ptree

Clear all error results in `ptree’, allowing the computation to resume from its latest pre-error state.


Create a ptree instance.

ptree defs &body body

Create a ptree using `flet’ syntax.

ptree ((node-name child-names function-body)*) form*

Each `node-name’ form corresponds to the definition of a ptree node.

`node-name’ is the name of the node being defined (a symbol).

`child-names’ is a list of the names of child nodes (symbols).

The function associated with the node being defined is

`(lambda ,child-names ,@function-body)

`child-names’ cannot contain lambda list keywords.

For each `node-name’, a symbol macro is defined which expands to a `call-ptree’ form for that node.

ptree-computed-p id ptree

Return true if the node with identifier `id’ in `ptree’ has finished computing, otherwise return false.

ptree-fn id args function ptree

Define a ptree node with identifier `id’, which is some unique object suitable for `eql’ comparison such as symbol.

The ids of its child nodes are elements of the list `args’.

`function’ is the function associated with this node. The arguments passed to `function’ are the respective results of the child node computations.

`ptree’ is the ptree instance in which the node is being defined.