Pre-RFC: Custom suffixes for integer and float literals

In my view, a macro based solution is not very optimal from the perspective of units (putting aside the complexity of other approaches). If you write say expr.si![unit] where expr is some expression and unit is some unit format the macro understands, then it is not particularly extensible to other forms of unit. This means that all units must be defined by the macro up front and thus you can’t compose units other than by using different macros.

At this stage, I think syntax is secondary. You first need to figure out the story around unification at the type level. As @varkor previously noted, this topic was further discussed over at Any RFC for Units of Measure?.

2 Likes