---
title: "newcclosure"
description: "Wraps a Luau callback in a C closure dispatcher."
---

```lua
newcclosure(fn: function): function
```

---

## Aliases

None.

---

## Arguments

<ParamField body="fn" type="function" required>
  The function to inspect or wrap.
</ParamField>

---

## Returns

<ResponseField name="wrapped" type="function">
  A C-closure wrapper, or an already suitable C closure.
</ResponseField>

An already suitable C closure can be returned unchanged. The dispatcher implements continuation support.

---

## Example

```lua
local wrapped = newcclosure(function(x) return x + 1 end)
print(wrapped(4), iscclosure(wrapped))
```
