OpenGOAL Reference
This is the main documentation for the OpenGOAL language. It's designed to be read in order to learn OpenGOAL. It does not explain the OpenGOAL kernel or state system.
The syntax descriptions uses these rules:
- Something
[in-brackets]
is optional and can be left out. - Something like
[:type type-name]
means there is an optional named argument.- It can be used like
:type type-name
, replacingtype-name
with what you want, or left out entirely.
- It can be used like
- When there are multiple choices, they are separated by
|
. Example:#t|#f
is either#t
or#f
. ...
means more of the thing before can be included. Example(f arg...)
can have multiple arguments.
📄️ Language basics
Basic overview of the language's main features and abilities
📄️ Type system
Type System Introduction
📄️ Method System
OpenGOAL has a virtual method system. This means that child types can override parent methods. The first argument to a method is always the object the method is being called on, except for new.
📄️ Syntax and examples
The Basics
📄️ Standard library
Runtime Functions
📄️ Reader
GOOS and GOAL both use the same reader, which converts text files to S-Expressions and allows these s-expressions to be mapped back to a line in a source file for error messages. This document explains the syntax of the reader. Note that these rules do not explain the syntax of the language (for instance, GOAL has a much more complicated system of integers and many more restrictions), but rather the rules of how your program source must look.
📄️ GOOS
GOOS is a macro language for GOAL. It is a separate language. Files written in GOAL end in .gc and files written in GOOS end in .gs. The REPL will display a goos> prompt for GOOS and gc > for GOAL.
📄️ Object file formats
CGO/DGO Files
📄️ Process and State
What is a process?
📄️ Font Color Tables
This page contains the font color table for each game. This table and the enum is defined in font-h.gc. It includes the color index (used for the L format command, e.g. ~3L will set the color to the one with index 3), the color name (used in the font-color enum) - whose value matches the index - and an example of how it looks like. Note that the table does not include alpha/transparency, it is shown here as pre-multiplied with the RGB values.