[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
proposed FORMAT hack
- To: BUG-LISP at MIT-MC, BUG-LISPM at MIT-AI
- Subject: proposed FORMAT hack
- From: Guy Steele <GLS at SU-AI>
- Date: Tue ,19 Jun 79 21:43:00 EDT
CC: GLS at SU-AI, RPG at SU-AI, GJS at MIT-AI
Let there be some new escape, say U. It gobbles two arguments;
one is a floating-point number (or is coerced to be one),
and the other is a symbol or string which is the "units" of the number,
which should be a metric word such as "meter" or "liter".
The operator scales the number to be "reasonable", then prints
the number, an appropriate metric prefix, the unit, and "s"
if that is appropriate. With the colon modifier, abbreviated
prefices are used. Example:
(format t ";~:U requires ~U" 4300.0 '|m| 0.0543 "liter")
";4.3 km requires 54.3 milliliters"
Maybe it's all pretty silly, but maybe from this someone can
invent a more useful theory.