Creating a struct containing "derived variables"

You may also want to take a look at the not-so-well-known Base.@kwdef macro