Lists/Maps/Sets (Was Re: The story of E, part 2 (fwd))

Douglas Crockford crockford@earthlink.net
Wed, 14 Oct 1998 18:21:37 -0700


>>aan(String)
>>      Return rec prefixed by "a " or "an " according to a simple (and
>therefore inadequate) heuristic.

Please consider Internationalization. Any function which is exclusively an
English-language function does not belong in String. Either put it in an
English processing class, or make it more general. For example:

  indefiniteArticle(String)
             Return an indefinite article matching the string in the current
language. If the current language does not have indefinite articles
(Japanese or Russian, for example) it returns null.

Be aware that there are rows of stacks of crates of cans of worms lurking
here. (Number, gender, declination, irregular forms, etc.)