I would like to be able to access a constant value from a name generated from a variable, e.g. if the variable contains '123' then get the contents of a constant named 'C123'.
After searching on here I can see that PHP is capable of doing that, but as I'm currently playing with Java, OCaml and Fortran I wondered if there was an equivalent for any of these languages?