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. Bash autocompletion
1.8. Zsh autocompletion
1.9. Comments
1.10. Variable and constant references
1.11. Data literals
1.12. Collection literals
1.13. Operators
1.14. Calling a method
1.15. Java / JVM arrays
2. Creating new project(s)
2.1. Free-form project
2.2. Maven-driven project
2.3. Gradle-driven project
3. Functions
3.1. Parameter-less functions
3.2. Functions with parameters
3.3. Variable-arity functions
3.4. Functions from other modules and imports
3.5. Local functions
4. Java interoperability
4.1. Main function Java compliance
4.2. Calling static methods
4.3. Calling instance methods
4.4. null-safe instance method invocations
4.5. Creating objects
4.6. Static fields
4.7. Instance fields
4.8. Inner classes and enumerations
4.9. Clashes with Golo operators and escaping
4.10. Golo class loader
5. Control flow
5.1. Conditional branching
5.2. case branching
5.3. match statements
5.4. while loops
5.5. for loops
5.6. foreach loops
5.7. break and continue
5.8. Why no value from most control flow constructions?
6. Exceptions
6.1. Raising exceptions
6.2. Raising specialized exceptions
6.3. Exception handling
7. Closures
7.1. Defining and using a closure
7.2. Compact closures
7.3. Calling closures
7.4. Limitations
7.5. Closures to single-method interfaces
7.6. Direct closure passing works
7.7. Conversion to single-method interfaces
7.8. Getting a reference to a closure / Golo function
7.9. Binding and composing
7.10. Calling functions that return functions
8. Predefined functions
8.1. Console output
8.2. Console input
8.3. Exceptions
8.4. Preconditions
8.5. Arrays (deprecated)
8.6. Ranges
8.7. Closures
8.8. File I/O
8.9. Array types
8.10. Misc.
9. Class augmentations
9.1. Wrapping a string with a function
9.2. Augmenting classes
9.3. Augmentation scopes, reusable augmentations
9.4. Standard augmentations
10. Structs
10.1. Definition
10.2. JVM existence
10.3. toString() behavior
10.4. Immutable structs
10.5. Copying
10.6. equals() and hashCode() semantics
10.7. Helper methods
10.8. Private members
10.9. Augmenting structs
11. Dynamic objects
11.1. Creating dynamic objects
11.2. Defining values
11.3. Defining methods
11.4. Querying the properties
11.5. Defining a fallback behavior
12. Adapters
12.1. A simple example
12.2. Implementing interfaces
12.3. Overrides
12.4. Star implementations and overrides
12.5. Misc.
13. Dynamic code evaluation
13.1. Loading a module
13.2. Anonymous modules
13.3. Functions
13.4. Running code
14. Concurrency with workers
14.1. The big picture
14.2. Worker environments
14.3. Spawning a worker and passing messages
14.4. A complete and useless example
15. Golo template engine
15.1. Example
15.2. Directives
16. Documenting Golo code
16.1. Documentation blocks
16.2. Rendering documentation
16.3. Alignment
17. Common pitfalls
17.1. new
17.2. Imports
17.3. Method invocations
17.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-2014 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.