Parametric polymorphism: Difference between revisions

m
Line 758:
end
 
Tree(v::T) where {T} = Tree(v, nothing, nothing) # Single arg constructor
# Constructor with default values
function Tree(v::T) where T
Tree(v, nothing, nothing)
end
 
"""
ApplyApplies `f` (element-wise and in-place) to the values in tree `bt`.
Also printsPrints the tree in an s-expression form *for demonstrative purposes only*,
new types should override the `show()` function for pretty-printing.
"""
Anonymous user