NeonModules help organize code into namespaces using a prefix (e.g., ModuleName~function).
~.# Define functions in the Math module
function Math~add(a, b) do
return (a + b)
end
function Math~sub(a, b) do
return (a - b)
end
# Use the module
result = Math~add(5, 3) # → 8
result = Math~sub(10, 4) # → 6
loadNamespace FunctionLoads all objects from a module without the prefix into the current scope.
# Define a module
function Geometry~circleArea(r) do
return (3.14159 * r ** 2)
end
# Load the module
loadNamespace("Geometry")
# Now use functions without prefix
area = circleArea(5) # → 78.53975
loadNamespace only affects already defined objects.import KeywordExecutes the contents of a .ne file (or AppVar on TI-EZ80).
import "filename" # Without .ne extension
# File: math.ne
function add(a, b) do
return (a + b)
end
# Main program
import "math"
print(add(2, 3)) # → 5
import "MYPROGRAM" # AppVar name (no extension)
import can take multiple filenames.;.