---
title: "Closures"
description: "Compilation, function hooks, and closure inspection."
icon: "code"
---

## Available functions

<div className="byte-function-directory">
<CardGroup cols={2}>
  <Card title="checkcaller" href="/reference/closures/checkcaller">
    Checks whether the current execution context is considered an executor caller.
  </Card>
  <Card title="clonefunction" href="/reference/closures/clonefunction">
    Clones a closure into a separate function object.
  </Card>
  <Card title="gettenv" href="/reference/closures/gettenv">
    Returns the specified thread's global environment.
  </Card>
  <Card title="hookfunction" href="/reference/closures/hookfunction">
    Installs a replacement and returns the original callable for delegation.
  </Card>
  <Card title="iscclosure" href="/reference/closures/iscclosure">
    Checks whether a value is a C closure.
  </Card>
  <Card title="isexecutorclosure" href="/reference/closures/isexecutorclosure">
    Checks whether Byte identifies a value as an executor-owned closure.
  </Card>
  <Card title="isfunctionhooked" href="/reference/closures/isfunctionhooked">
    Queries Byte's managed hook state.
  </Card>
  <Card title="islclosure" href="/reference/closures/islclosure">
    Checks whether a value is a Lua closure.
  </Card>
  <Card title="isnewcclosure" href="/reference/closures/isnewcclosure">
    Checks whether Byte tracks the function as a newcclosure wrapper.
  </Card>
  <Card title="isnewlclosure" href="/reference/closures/isnewlclosure">
    Checks whether Byte tracks the function as a newlclosure wrapper.
  </Card>
  <Card title="loadstring" href="/reference/closures/loadstring">
    Compiles Luau source without executing it.
  </Card>
  <Card title="newcclosure" href="/reference/closures/newcclosure">
    Wraps a Luau callback in a C closure dispatcher.
  </Card>
  <Card title="newlclosure" href="/reference/closures/newlclosure">
    Returns a Lua closure, wrapping a C function when necessary.
  </Card>
  <Card title="restorefunction" href="/reference/closures/restorefunction">
    Restores a function managed by Byte's hook tracking.
  </Card>
</CardGroup>
</div>
