J
James Kuyper
Currencies are a mess. Not only are they not comparable from country to
country, but they are not comparable from time period to time period.
Even the way they are adjusted for inflation is a political process.
People with different agendas pick measures of inflation that emphasize
or deemphasize it. Making those choices, I think, is beyond the scope
of a programming language.
I want to emphasize that what I'm about to say is NOT a proposed change
to C; just a feature that it would be entirely feasible to put in a new
language, and one that may be similar to a feature already supported by
some language I'm not familiar with:
It would be quite feasible for a programming language to enforce
dimensional analysis rules, and allow user-define dimensions such as
dollars_now and dollars_then. The user could then declare that
inflation_factor has the units "dollars_now / dollars_then". A program
that used a fixed reference year could define a unit such as dollars_2005.
Defining a system where a unit could be parametrized, such as
dollars['2011-10-18'] would be possible, but much more complicated, and
probably not worthwhile.