Appendix A. Boo basic reference

 

This appendix deals with how to use Boo as a programming language, and aims mostly to get you familiarized with its syntax and behavior. It intentionally leaves out some details in order to speed the learning process and to provide a smooth path for learning to both write and read Boo programs. Appendix B supplies the details and is more rigorous in presenting the language.

For additional information about Boo, please visit Boo’s site (http://boo.codehaus.org). For more information about the advanced features of Boo (those that make it so applicable as a DSL host language), please refer back to chapters 2 and 6.

Note

This appendix was adapted from a Boo tutorial by Brent W. Hughes (http://home.comcast.net/~brent.hughes/BooWho.htm). I would like to thank Brent for writing this tutorial and allowing me to reuse it.

A.1. Prerequisites

It is assumed that you already know a little about programming—for example, what variables and functions are. It is also assumed that you have ready access to Boo’s interpreter, complier, and interactive shell so you can experiment with the language as we go along. You can download these materials from Boo’s website at http://boo.codehaus.org/.

A.2. The Boo interactive shell, interpreter, and compiler

For many of our examples, we will use booish, the Boo interactive shell. It acts much like a Boo-powered calculator, which is very convenient when you wish to quickly try out some ideas.

A.3. Comments

A.4. Control statements

A.5. Types

A.6. Creating real programs

A.7. Generators