On Wed, Nov 3, 2010 at 1:20 PM, Thomas Chust <ch...@web.de> wrote:
> 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

I'm not quite sure understand the idea. You mean (current-locale)
could not be the POSIX locale?

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

Reply via email to