So, in objective C, and C/C++, and .NET, and pretty much all other languages I've used, you can declare constants that can include previous constants, like
#define PI 3.14159
#define HALFPI (PI/2)
const CGFloat BOTTOM_BAR_HEIGHT = 200;
const CGFloat BOTTOMBARCONTENTS_DY = BOTTOM_BAR_HEIGHT/2;
But this doesn't seem to work in swift
let PI=3.14159
let HALF_PI=PI/2
This is a really useful pattern if you're trying to do things like (one among many examples) layout dimensions, or really any set of constants that are interdependent. Is there any way to achieve this pattern in swift, without declaring them as vars and setting them in an initializer function (which will double the size and reduce maintainability of some really lengthy code, incur whatever low-level penalties for using vars instead of lets, and ruin my first impression of swift)? Thanks.