Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Understanding Types

Understanding the type system.

In this chapter, you will learn about the typing system. haXe is a strongly typed language but provides quite a lot of features such as type inference and Dynamic objects.

haXe has a typing system, which offers a lot of features. Understanding these features is very important to write and debug your programs. It will also help you make the most out of haXe.

In this chapter, we will:

  • Talk about explicitly typed variables

  • Talk about function's type.

  • Learn what type inference is

  • Learn how to cast variables

  • Learn about type parameters

  • See what type parameters are used for

  • How you can use them with already created types

  • How you can create a type that makes use of them

  • Create an example

All of these points are fairly easy to understand and we are going to illustrate them in several exercises.