11.1 General A class defines a user-defined reference type that combines data and executable behaviour into a single declaration. A class may declare: A class declaration introduces a new named type. 11.2 Class Declarations A class declaration specifies: The class body contains the declarations that define the state and behaviour of instances of the class. […]
Chapter 11. Classes
Chapter 10. Generic Programming
10.1 General Generic programming enables algorithms and data types to operate upon values whose types are specified when the generic entity is used rather than when it is declared. A single generic declaration therefore describes a family of related declarations. Generic programming promotes type safety, code reuse, and compile-time verification without sacrificing performance. Generic facilities […]
Chapter 9. Overload Resolution
9.1 General Buoy permits multiple Functions and Subs to share the same name, provided that each declaration is distinguishable by its parameter list. When a routine is invoked, the compiler determines which declaration is intended by applying the overload resolution rules defined in this chapter. Overload resolution is performed entirely at compile time. 9.2 Candidate […]
Chapter 8. Functions and Subs
8.1 General Functions and Subs are the primary executable units of a Buoy program. Both define reusable sequences of statements that may accept parameters. A Function computes and returns a value to its caller. A Sub performs an action and does not return a value. Although Functions and Subs share much of their syntax and […]
Chapter 7. Statements
7.1 General A statement describes an action performed during program execution. Statements control the flow of execution, modify program state, invoke routines, and introduce local declarations. A Buoy program executes by evaluating statements in the order determined by the language’s control-flow rules. 7.2 Statement Categories The language defines the following categories of statements: Additional statement […]
Chapter 6. Expressions
6.1 General An expression specifies a computation that produces a value. Expressions are formed from literals, variables, constants, function invocations, operators, and other expressions. Every expression has a compile-time type that determines the operations that may be performed upon the resulting value. Unless otherwise specified, evaluation of an expression does not modify program state. 6.2 […]
Chapter 5. Variables and Constants
5.1 General Variables and constants associate names with values. A variable denotes a storage location whose value may change during program execution. A constant denotes a value that, once established, cannot subsequently be modified. Both variables and constants are introduced by declarations. 5.2 Variable Declarations A variable declaration introduces one or more variables into the […]
Chapter 4. The Type System
4.1 General Every value in Buoy has a type. A type defines the set of values that may be represented together with the operations that may be performed upon those values. The compiler uses type information to verify program correctness, resolve overloaded routines, infer the types of expressions, and generate efficient executable code. Buoy is […]
Chapter 3. Program Structure
3.1 General A Buoy program consists of one or more source files compiled as a single program or library. A source file contains declarations that define the program’s types, variables, constants, callable routines, and other program elements. Depending upon the declaration, executable statements may also appear within the source file. The organization of declarations determines […]
Chapter 2. Lexical Structure
2.1 General A Buoy program consists of one or more source files containing Unicode text. During compilation, each source file is transformed into a sequence of lexical elements known as tokens. Tokens are the smallest meaningful elements of the language and include identifiers, keywords, literals, operators, punctuation, and comments. Except where explicitly stated, whitespace and comments […]
