-
Notifications
You must be signed in to change notification settings - Fork 620
Open
Labels
Description
A common situation is to have a bunch of constants associated with a specific component, e.g.:
impl DrawOrder {
/// Draw order used for images if no draw order was specified.
pub const DEFAULT_IMAGE: DrawOrder = DrawOrder(-10.0);
/// Draw order used for 2D boxes if no draw order was specified.
pub const DEFAULT_BOX2D: DrawOrder = DrawOrder(10.0);
/// Draw order used for 2D lines if no draw order was specified.
pub const DEFAULT_LINES2D: DrawOrder = DrawOrder(20.0);
/// Draw order used for 2D points if no draw order was specified.
pub const DEFAULT_POINTS2D: DrawOrder = DrawOrder(30.0);
}Now of course we need to manually redefine those in every languages, leading to the usual problems.
We could have some kind of very light flatbuffers DSL in order to centralize these constants and let codegen handle the rest.