by newen · 5y ago · 0 comments
julia> function Base.getproperty(x::Tuple, f::Symbol)
if f == :a
return x[1]
elseif f == :b
return x[2]
else
return x[3]
end
end
julia> (3,4,5).a
3
Edit: Okay, why am I getting randomly downvoted here?No comments yet.