[Ocaml-i18n] Re: [Caml-list] Camomile-0.5.0

skaller skaller at users.sourceforge.net
Fri Jun 11 19:16:38 PDT 2004


On Sat, 2004-06-12 at 09:27, Yamagata Yoriyuki wrote:

> There is a tension between purely functional style and the style using
> implicit states.  I am not sure about which style is better.

I am quite sure. Implicit state is VERY BAD especially
for i18n.

you *will* need to provide hooks to obtain locale,
language, etc objects from current locale, environment
variables, command line, config files, and other 
common places.

But no function that actually does any I18n work should
access these directly. Always allow to pass all the I18n
information explicitly.

It is quite possible for an application to need
to simultaneously process multiple languages, multiple
locales, etc, often concurrently.

As mentioned in a note before Australia's Motor Traffic
Authority uses a computerised theory test to licence
car drivers in a selectable language (obviously
it's a server with multiple terminals).

My Interscript literate programming tool can be commanded:

iscr --language=en --language=es --language=fr ..
--weaver=latex --weaver=html sample.pak

which produces latex and html documents in English,
Spanish, and French simultaneously.

You should note the C++ Standard Library which
has locale objects which are used to 'imbue'
various things that need them, such as IOstreams.
[They default to the current C locale I believe]

You might argue that a default could be used.
I could even argue against that: we should
not encourage people to ignore i18n. That default
argument may need to be 'undefaulted' later down
the track in development, and suddenly the calling
function cannot pass the information because *it*
was not passed it. So the whole of the program
may have to be edited to pass the object from
the mainline, or, the programmer will cheat 
and use a global variable .. which again makes
their code dysfunctional.


-- 
John Skaller, mailto:skaller at users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net






More information about the Ocaml-i18n mailing list