2010/11/3 Hugo Arregui <hugo.arre...@gmail.com>:
> [...]
> 1) Using posix:
>
> (use posix)
> (time->string (string->time "2" "%d"))
> "Tue Jan  2 00:00:00 1900"
>
> but, my current locale es:
>
> (use locale)
> (current-locale)
> "es_AR.utf8"
> [...]

Hello,

the POSIX functions use the C standard library's locale which is entirely
independent from that of the locale egg.

In fact, if you set the C library's locale to anything else than "C", all hell
breaks lose inside CHICKEN: For example the reader will no longer recognize
floating point numbers in the standard Scheme format. If you are lucky numbers
in the C library locale's format will be recognized, but if the locale happens
to change the decimal point to something else than #\. it is very likely that no
floating point numbers will be recognized at all by the reader.

If you change the C library's locale at all from inside a Scheme program, I
would advise to keep this change strictly local to the application of procedures
like time->string and always ensure that the locale is reset to "C" upon exit
from the relevant dynamic scopes.

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to