added consistent _main

This commit is contained in:
Luxferre
2026-07-04 09:23:54 +03:00
parent bee949ccbc
commit ce18aa76b5
4 changed files with 48 additions and 8 deletions
+5
View File
@@ -8,6 +8,11 @@ The Clyx runtime itself allows the programmer to redefine any already defined wo
The conventional source file suffix for Clyx code is `.clx`.
### Execution and Entry Point
The Clyx interpreter accepts one or more `.clx` source files as command-line arguments. If multiple files are specified, the interpreter executes them in the order they are passed.
After running all specified source files, the interpreter checks if a word named `_main` is defined in the workspace. If `_main` is present, it is automatically executed as the program's entry point. If no arguments are passed, it runs the standard interactive REPL.
With the reference implementation installed in a POSIX-compatible environment, Clyx program sources may be made executable if they start with a `#!/usr/bin/env clyx` shebang.
---