[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dave.Touretzky@B.GP.CS.CMU.EDU: pluralization: two proposals]



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!