summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/example0.luma17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/example0.luma b/examples/example0.luma
new file mode 100644
index 0000000..8a7f9c8
--- /dev/null
+++ b/examples/example0.luma
@@ -0,0 +1,17 @@
+\ '\' defines single-line comments.
+\<
+ '\<' followed by '\>' defines multi-line comments.
+ The contents of multi-line comments must be indented.
+ Indentation is always a tab in Luma.
+\>
+\ Modules are automaticly imported by the interpreter.
+\ Modules are folders with source code. Each source file contains the definition of the name of the file.
+\ /gfx/win_t (example module) will be defined in the file win_t.luma which itself is inside the gfx folder.
+\ This makes is easy for the interpreter to find the definitions. Therefore, each file in a module must only contain one definition.
+\ This has the drawback of making single-file programs impossible if they want to utilize non-centralized modules.
+\ A fix to this is to put the source files in an archive (like a Tarball), which is already a standard thing to do.
+\ Define variable main of type void_t as function that doesn't return.
+void_t:main -fn [] -noret
+ // Use '$' followed by a dozenal number to
+ /std/fout "1 + 1 = $0" (#1 + #1)
+ exit