January 2020
Intermediate to advanced
532 pages
13h 31m
English
Type III piracy refers to the situation where a function is extended, but is used for a different purpose. It is the right procedure of extending code, but done in a bad way. This kind of piracy is also called a pun by the Julia developers. To understand what it is, let's consider a fun example here.
Suppose that we are developing a simple party registration application. The type definition and constructor are shown here:
# A Party just contains a title and guest namesstruct Party title::String guests::Vector{String}end# constructorParty(title) = Party(title, String[])
The Party type contains just a title and an array of guest names. The constructor just takes the ...
Read now
Unlock full access