The ooc language in a few chapters
The language has grown over the years, but it’s still relatively tidy. Here’s a list of sections of the language documentation:
-
The Modules chapter discusses
.ooc
files, what a module is, what a package is, how imports and includes work. -
The Values chapter talks number literals, string literals, operators, variable declarations, and a few built-in types.
-
The Control Structures chapter describes mundane constructs like if, else, for, while, break, continue, but also match.
-
The Data Structures chapter talks about arrays and maps, among other things.
-
The Functions chapter will teach you anything from declaring function to calling them, to using external functions (from a C library, for example), but also variable arguments, default arguments, first-class functions and a nice syntax for closures.
-
The Classes chapter is here to help you realize that ooc classes are a lot like Java classes, except when they are not. Constructors, inheritance, abstract methods, initializers, and even interfaces have found their way in here.
-
The Operators chapter lists various mathematic and logic operators, their priorities, how to overload them, etc.
-
The Covers chapter discusses a construct halfway between C structs and ooc classes, that is a major actor in making C libraries easier to use.
-
The Enums chapter goes over the last kind of ooc types - an enumeration of things. How to define them, use them, you name it. (No, seriously, anonymous enums don’t exist)
-
The Tuples chapter explains what tuples are and what they aren’t. It covers multi-return, multi-declaration, variable swapping, and cover literals.
-
The Generics chapter talks about parameterized types, how to define them, how to use them, what are their strong points and their shortcomings.
-
The Exceptions chapter talks about error handling, how to throw and catch Exceptions, and how to create your own exception types.
-
The Preprocessor describes what happens to the code before it is even compiled.
If after reading those few pages you still have questions about the ooc language, feel free to ask on our discussion group (see Community).