{
  "id": "fn-core-include",
  "dataComponent": "core",
  "heading": {
    "title": "include",
    "badges": [
      "Core",
      "Dynamic"
    ]
  },
  "synopsis": "Executes a Lava (.mu) file at runtime, registering any functions or variables it defines. Returns an array of new function names imported.",
  "codeBlocks": [
    "# 1) Basic usage:\ninclude(\"my_module.mu\")\n\n# 2) After including, any new functions or variables defined in 'my_module.mu' are now available.\n\n# 3) The return value is a string array of newly imported function names.\n\n# Example:\n# Suppose 'my_module.mu' defines:\n#   hello = () => \"hi\"\n#   foo = x => x + 1\n\nresult = include(\"my_module.mu\")\nsput(result)\n# => [\"hello\", \"foo\"]"
  ],
  "notes": [
    "Accepts exactly one argument: the path to a `.mu` file (as a string).",
    "Loads and executes all statements in the file immediately.",
    "Any functions (or dynamic functions) defined in that file become available in the current interpreter context.",
    "The return value is a string array of newly imported function names (those not already present before the include).",
    "If the file does not exist or contains errors, an error is raised.",
    "This is similar to `extend(...)`, but works with plain Lava scripts instead of dynamic libraries."
  ]
}
