Language

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:

  1. The Modules chapter discusses .ooc files, what a module is, what a package is, how imports and includes work.

  2. The Values chapter talks number literals, string literals, operators, variable declarations, and a few built-in types.

  3. The Control Structures chapter describes mundane constructs like if, else, for, while, break, continue, but also match.

  4. The Data Structures chapter talks about arrays and maps, among other things.

  5. 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.

  6. 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.

  7. The Operators chapter lists various mathematic and logic operators, their priorities, how to overload them, etc.

  8. 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.

  9. 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)

  10. The Tuples chapter explains what tuples are and what they aren’t. It covers multi-return, multi-declaration, variable swapping, and cover literals.

  11. The Generics chapter talks about parameterized types, how to define them, how to use them, what are their strong points and their shortcomings.

  12. The Exceptions chapter talks about error handling, how to throw and catch Exceptions, and how to create your own exception types.

  13. 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).