Book Image

Mastering Julia

Book Image

Mastering Julia

Overview of this book

Table of Contents (17 chapters)
Mastering Julia
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Julia's type system


Julia is not an object-oriented language, so when we speak of objects, they are a different sort of data structure from those in traditional O-O languages.

Julia does not allow types to have methods, so it is not possible to create subtypes that inherit methods. While this might seem restrictive, it does permit methods to use a multiple dispatch call structure rather than the single dispatch system employed in object-orientated ones.

Coupled with Julia's system of types, multiple dispatch is extremely powerful. Moreover, it is a more logical approach for data scientists and scientific programmers, and if for no other reason than exposing this to you, the analyst/programmer is a reason to use Julia. In fact, there are lots of other reasons as well, as we will see later.

A look at the rational type

The rational number type was introduced in the previous chapter, and like most of Julia, it is implemented in the language itself and the source is in base/rational.jl and is available...