I thought I once remmebered reading about FORMAT being able to do
cardinality (or whatever that's caled), i.e.
(format nil "~<some-character>" 3)
==> "third"
Does format do that? If so, what's the directive? I looked through the
CLHS, but didn't see it there. What _was_ there was the ~R directive,
which would print "three" in the above case, but I want "third", etc.
thanks,
dave
That's ordinal.
>Does format do that? If so, what's the directive? I looked through the
>CLHS, but didn't see it there. What _was_ there was the ~R directive,
>which would print "three" in the above case, but I want "third", etc.
If you read the full description of ~R, you'd see that the : modifier
does what you want.
--
Barry Margolin, bar...@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Try "~:R" instead of "~R":
* (format t "~a ~R ~:R~%" 3 3 3)
3 three third
--
Raymond Wiker Mail: Raymon...@fast.no
Senior Software Engineer Web: http://www.fast.no/
Fast Search & Transfer ASA Phone: +47 23 01 11 60
P.O. Box 1677 Vika Fax: +47 35 54 87 99
NO-0120 Oslo, NORWAY Mob: +47 48 01 11 60
Try FAST Search: http://alltheweb.com/
Check out the : and @ modifiers to format control characters.
///
--
The past is not more important than the future, despite what your culture
has taught you. Your future observations, conclusions, and beliefs are
more important to you than those in your past ever will be. The world is
changing so fast the balance between the past and the future has shifted.
Note, however, if you have an older copy of lispworks, you might have
trouble with certain negative multiples of 10 (they fixed it a few
months ago):
(format nil "~:R" -90)
=> "ninetieth"
(format nil "~:R" -80)
=> "eightieth"
(format nil "~:R" -89)
=> "minus eighty-ninth"
Eric