Derived and composite types
Julia implements a composite-aggregation object model rather than the most common inheritance ones, which are all used for sub-typing and polymorphism.
While this might seem restrictive, it allows the use of a multiple dispatch call mechanism rather than the single dispatch one employed in the usual 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, 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 in this chapter.
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. The source is in base/rational.jl
and is available for inspection.
To see the source code for Julia, go to...