unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [Request] How about adding with-locale?
@ 2012-03-24  4:37 Nala Ginrut
  2012-03-24  4:43 ` Nala Ginrut
  2012-04-02 15:29 ` Ludovic Courtès
  0 siblings, 2 replies; 10+ messages in thread
From: Nala Ginrut @ 2012-03-24  4:37 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

Hi folks!
I encountered a bug in my project for these days. Finally I realized it's
because of my locale is zh_CN.UTF-8 in default. But in many protocols, it
needs
the result of strftime be in English. Anyway, I think there should be an
elegant way to change locale temperately. So I think maybe with-locale
would be useful.

---------------------------------------------------------------------
(define-syntax-rule (with-locale i c e0 e1 ...)
  (let ([old (setlocale i)])
    (dynamic-wind
    (lambda () (setlocale i c))
    (lambda () (begin e0 e1 ...))
    (lambda () (setlocale i old)))))
---------------------------------------------------------------------

What you guys think?

Regards.

[-- Attachment #2: Type: text/html, Size: 767 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-04-02 16:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24  4:37 [Request] How about adding with-locale? Nala Ginrut
2012-03-24  4:43 ` Nala Ginrut
2012-03-24  6:54   ` Mark H Weaver
2012-03-24  8:45     ` Nala Ginrut
2012-03-24 10:24       ` Mark H Weaver
2012-03-24 12:42         ` Nala Ginrut
2012-03-24 17:56           ` Mark H Weaver
2012-04-02 15:27     ` Ludovic Courtès
2012-04-02 16:28       ` Nala Ginrut
2012-04-02 15:29 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).