Task

Write a program to perform a conversion of the old Russian measures of length to the metric system   (and vice versa).



It is an example of a linear transformation of several variables.



The program should accept a single value in a selected unit of measurement, and convert and return it to the other units:

vershoks, arshins, sazhens, versts, meters, centimeters and kilometers.



Also see

   Old Russian measure of length


arshin  := (2 + 1/3) ft
vershok := 1/16 arshin
sazhen  := 3 arshin
verst   := 1500 arshin
versta  := verst
 
do
{
   valstr = input["Enter unit of measure: ", "1 arshin"]
   val = eval[valstr]
   if ! (val conforms length)
      println["$valstr is not a unit of length."]
} until val conforms length
 
println["$valstr = "]
println["     " + (val -> "arshin")]
println["     " + (val -> "vershok")]
println["     " + (val -> "sazhen")]
println["     " + (val -> "verst")]
println["     " + (val -> "feet")]
println["     " + (val -> "meters")]
println["     " + (val -> "centimeters")]
println["     " + (val -> "kilometers")]