[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dave.Touretzky@B.GP.CS.CMU.EDU: pluralization: two proposals]
- To: Dave.Touretzky@cs.cmu.edu
- Subject: [Dave.Touretzky@B.GP.CS.CMU.EDU: pluralization: two proposals]
- From: Guy Steele <gls@Think.COM>
- Date: Tue, 7 Mar 89 14:12:53 EST
- Cc: Moon@stony-brook.scrc.symbolics.com, gls@Think.COM, cl-cleanup@sail.stanford.edu
- In-reply-to: Dave.Touretzky@b.gp.cs.cmu.edu's message of Mon, 06 Mar 89 21:27:21 EST <5529.605240841@DST.BOLTZ.CS.CMU.EDU>
I believe that some languages have special dual forms (for the case of
exactly two things). At the risk of hairing things up, allow me to propose
that there can be more than two clauses, and nonpositive numbers or
positive numbers that are too large use the last clause; if the first
clause ends with ~:; then that clause is for zero, and the others follow.
Hence:
(defun rats (x)
(format nil "I fixed ~!:@=!P[no~:;one~;both~;~*~D~] ~
~*~@:!P[mouse~;mice~]" x))
(rats -1) => "I fixed -1 mice"
(rats 0) => "I fixed no mice"
(rats 1) => "I fixed one mouse"
(rats 2) => "I fixed both mice" ;Note dual form in English!
(rats 3) => "I fixed 3 mice"
Hm. Maybe ~@; should terminate a clause that handles just negative
numbers.
(defun rodents (x)
(format nil "I fixed ~!:@=!P[~*~D~@;no~:;one~;both~;all the~] ~
~*~@:!P[mouse~;mice~]" x))
(rodents -1) => "I fixed -1 mice"
(rodents 0) => "I fixed no mice"
(rodents 1) => "I fixed one mouse"
(rodents 2) => "I fixed both mice" ;Note dual form in English!
(rodents 3) => "I fixed all the mice"
Um... Dave? DAVE? What are you doing with that stick? NO, MOON, NO!
AAAEIEAIAIEIIEIEIEIIIIIIEEIIEEEEEEEEEE!