> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# func

> Mark a function as callable from within a @program body

```python  theme={null}
from grid_nexus_program import func
```

```python Signature theme={null}
func(fn: Callable[..., Any]) -> Callable[..., Any]
```

Mark a function as callable from within a @program body.

Only functions decorated with @func can be captured as pure computation
nodes in the dataflow graph.  Unmarked callables found in scope will
raise a compile-time error.

Usage::

import grid\_nexus\_program as zd

@zd.func
def depth\_to\_command(depth\_map):
...

@zd.program
def controller(robot: zd.Robot, cortex: zd.Cortex):
command = depth\_to\_command(depth\_map)


## Related topics

- [Your first skill](/get-started/first-skill.md)
