Myriam Abramson <········@osf1.gmu.edu> writes:
> How do I form the plural of "inch" to "inches"?
"~P" does not support that, but you can get a similar effect with "~[":
(format t "inch~[es~;~:;es~]" 2)
i.e., format "es" if the argument is 0, nothing if it is 1, or
"es" otherwise.
However, this cannot handle floating-point numbers. If you need
to support them too, it may be easiest to insert (eql 2 1) as a
separate argument. If you can't change the list of arguments,
you could put the comparison in a function and call that with "~/".
> (format t "inch~:P" 2 )
Don't do that. With the colon modifier, tilde-P backs to the
previous argument, but here you have no previous argument.