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

Re: Various things

This page is part of the web mail archives of SRFI 48 from before July 7th, 2015. The new archives for SRFI 48 contain all messages, not just those from before July 7th, 2015.

One thing I don't think belongs in this library is the ~p plural.

That's very specific to English.  And even in English, its sense
is reversed when you're pluralizing verbs instead of nouns (there,
the *singular* most frequently has the 's' added and the *plural*
is most frequently without it).

This stuff should be locale-dependent, or possibly dynamic, or possibly
part of a different library altogether.

To really address it adequately you'd need a semantics that allowed
function calls determined by the contents of the format string, so
somebody could write, eg:

(let ((format-e (lambda (arg) (if (> arg 1) "s" "")))
      (format-b (lambda (arg) (if (> arg 1) "" "s")))
      (format-c (lambda (arg) (if (> arg 1) "ves" "f"))))
   (format "The wol~c chase~b the boy~e across the snow."
             wolfcount wolfcount boycount))

which makes the whole thing into effectively a dynamic-dispatch
system.  Then people working with other languages could define
different format-* forms specific to each target language and take
into account things like masculine vs. feminine, nominative vs.
genitive, and so on.

But I don't think you really want to bite off language-specific
stuff with this library.