The Golo Programming Language


Table of Contents

1. Basics
1.1. Editor / IDE support
1.2. Hello world
1.3. Running "Hello world"
1.4. Compiling Golo source code
1.5. Running compiled Golo code
1.6. Passing JVM-specific flags
1.7. Comments
1.8. Variable and constant references
1.9. Data literals
1.10. Collection literals
1.11. Operators
1.12. Calling a method
1.13. Java / JVM arrays
2. Functions
2.1. Parameter-less functions
2.2. Functions with parameters
2.3. Variable-arity functions
2.4. Functions from other modules and imports
2.5. Local functions
3. Java interoperability
3.1. Calling static methods
3.2. Calling instance methods
3.3. null-safe instance method invocations
3.4. Creating objects
3.5. Static fields
3.6. Instance fields
3.7. Inner classes and enumerations
3.8. Clashes with Golo operators and escaping
3.9. Golo class loader
4. Control flow
4.1. Conditional branching
4.2. case branching
4.3. match statements
4.4. while loops
4.5. for loops
4.6. foreach loops
4.7. break and continue
4.8. Why no value from most control flow constructions?
5. Exceptions
5.1. Raising exceptions
5.2. Raising specialized exceptions
5.3. Exception handling
6. Closures
6.1. Defining and using a closure
6.2. Compact closures
6.3. Calling closures
6.4. Limitations
6.5. Closures to single-method interfaces
6.6. Conversion to single-method interfaces
6.7. Getting a reference to a closure / Golo function
6.8. Binding and composing
6.9. Calling functions that return functions
7. Predefined functions
7.1. Console output
7.2. Console input
7.3. Exceptions
7.4. Preconditions
7.5. Arrays (deprecated)
7.6. Ranges
7.7. Closures
7.8. File I/O
7.9. Array types
7.10. Misc.
8. Class augmentations
8.1. Wrapping a string with a function
8.2. Augmenting classes
8.3. Augmentation scopes, reusable augmentations
8.4. Standard augmentations
9. Structs
9.1. Definition
9.2. JVM existence
9.3. toString() behavior
9.4. Copying
9.5. equals() and hashCode() semantics
9.6. Helper methods
10. Dynamic objects
10.1. Creating dynamic objects
10.2. Defining values
10.3. Defining methods
10.4. Querying the properties
11. Adapters
11.1. A simple example
11.2. Implementing interfaces
11.3. Overrides
11.4. Star implementations and overrides
11.5. Misc.
12. Dynamic code evaluation
12.1. Loading a module
12.2. Anonymous modules
12.3. Functions
12.4. Running code
13. Concurrency with workers
13.1. The big picture
13.2. Worker environments
13.3. Spawning a worker and passing messages
13.4. A complete and useless example
14. Golo template engine
14.1. Example
14.2. Directives
15. Common pitfalls
15.1. new
15.2. Imports
15.3. Method invocations
15.4. match is not a closure

This is the documentation for the Golo programming language.

Caution

This is a work in progress. Golo is even far from being feature-complete. You have been warned, but hey, you somehow knew it I’m pretty sure.

Copyright and License Notice. 

Copyright 2012-2013 Institut National des Sciences Appliquées de Lyon (INSA-Lyon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.