January 2020
Intermediate to advanced
532 pages
13h 31m
English
An important feature of the parametric method is that the type variable specified in the where clause is also accessible from the method body. Contrary to what you might think, this is not always true. Here, we will present a case where the type variable is not available at runtime.
Consider the following functions:
mytypes1(a::Array{T,1}, x::S) where {S <: Number, T <: S} = Tmytypes2(a::Array{T,1}, x::S) where {S <: Number, T <: S} = S
We can use the mytypes1 and mytypes2 functions to experiment with what type variables are derived by the Julia runtime. Let's start with the happy case:

However, the picture ...
Read now
Unlock full access