[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.5-23-ge7f769
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.5-23-ge7f7691 |
Date: |
Fri, 03 Feb 2012 19:11:07 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=e7f7691f5f5c2ecc2b6b828322e6bf3ccb130622
The branch, stable-2.0 has been updated
via e7f7691f5f5c2ecc2b6b828322e6bf3ccb130622 (commit)
from b4af80a4231c1b2296a3ee8397fdbb975692ed75 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e7f7691f5f5c2ecc2b6b828322e6bf3ccb130622
Author: Ludovic Courtès <address@hidden>
Date: Fri Feb 3 20:11:00 2012 +0100
i18n: Provide default values for when Gnulib has no replacement.
This reverts parts of a0919aefee7512686c3374876df2c549fd47e071 ("i18n:
Use Gnulib's `nl_langinfo' module.").
* module/ice-9/i18n.scm (define-simple-langinfo-mapping): Re-add
`default' parameter, and update users accordingly.
-----------------------------------------------------------------------
Summary of changes:
module/ice-9/i18n.scm | 58 +++++++++++++++++++++++++++----------------------
1 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/module/ice-9/i18n.scm b/module/ice-9/i18n.scm
index c574a7e..ca949b4 100644
--- a/module/ice-9/i18n.scm
+++ b/module/ice-9/i18n.scm
@@ -101,7 +101,7 @@
;;;
;; Helper macro: Define a procedure named NAME that maps its argument to
-;; NL-ITEMS (when `nl-langinfo' is provided).
+;; NL-ITEMS. Gnulib guarantees that these items are available.
(define-macro (define-vector-langinfo-mapping name nl-items)
(let* ((item-count (length nl-items))
(defines `(define %nl-items (vector #f ,@nl-items)))
@@ -136,33 +136,39 @@
;;;
;; Define a procedure NAME that gets langinfo item ITEM. Gnulib's
-;; `nl_langinfo' guarantees that all these items are supported.
-(define-syntax-rule (define-simple-langinfo-mapping name item)
- (define* (name #:optional (locale %global-locale))
- (nl-langinfo item locale)))
+;; `nl_langinfo' does not guarantee that all these items are supported
+;; (for instance, `GROUPING' is lacking on Darwin and Gnulib provides no
+;; replacement), so use DEFAULT as the default value when ITEM is not
+;; available.
+(define-macro (define-simple-langinfo-mapping name item default)
+ (let ((body (if (defined? item)
+ `(apply nl-langinfo ,item locale)
+ default)))
+ `(define (,name . locale)
+ ,body)))
(define-simple-langinfo-mapping locale-am-string
- AM_STR)
+ AM_STR "AM")
(define-simple-langinfo-mapping locale-pm-string
- PM_STR)
+ PM_STR "PM")
(define-simple-langinfo-mapping locale-date+time-format
- D_T_FMT)
+ D_T_FMT "%a %b %e %H:%M:%S %Y")
(define-simple-langinfo-mapping locale-date-format
- D_FMT)
+ D_FMT "%m/%d/%y")
(define-simple-langinfo-mapping locale-time-format
- T_FMT)
+ T_FMT "%H:%M:%S")
(define-simple-langinfo-mapping locale-time+am/pm-format
- T_FMT_AMPM)
+ T_FMT_AMPM "%I:%M:%S %p")
(define-simple-langinfo-mapping locale-era
- ERA)
+ ERA "")
(define-simple-langinfo-mapping locale-era-year
- ERA_YEAR)
+ ERA_YEAR "")
(define-simple-langinfo-mapping locale-era-date+time-format
- ERA_D_T_FMT)
+ ERA_D_T_FMT "")
(define-simple-langinfo-mapping locale-era-date-format
- ERA_D_FMT)
+ ERA_D_FMT "")
(define-simple-langinfo-mapping locale-era-time-format
- ERA_T_FMT)
+ ERA_T_FMT "")
@@ -198,15 +204,15 @@
2 2)
(define-simple-langinfo-mapping locale-monetary-positive-sign
- POSITIVE_SIGN)
+ POSITIVE_SIGN "+")
(define-simple-langinfo-mapping locale-monetary-negative-sign
- NEGATIVE_SIGN)
+ NEGATIVE_SIGN "-")
(define-simple-langinfo-mapping locale-monetary-decimal-point
- MON_DECIMAL_POINT)
+ MON_DECIMAL_POINT "")
(define-simple-langinfo-mapping locale-monetary-thousands-separator
- MON_THOUSANDS_SEP)
+ MON_THOUSANDS_SEP "")
(define-simple-langinfo-mapping locale-monetary-digit-grouping
- MON_GROUPING)
+ MON_GROUPING '())
(define-monetary-langinfo-mapping locale-currency-symbol-precedes-positive?
P_CS_PRECEDES INT_P_CS_PRECEDES
@@ -352,11 +358,11 @@ locale is used."
;;;
(define-simple-langinfo-mapping locale-digit-grouping
- GROUPING)
+ GROUPING '())
(define-simple-langinfo-mapping locale-decimal-point
- RADIXCHAR)
+ RADIXCHAR ".")
(define-simple-langinfo-mapping locale-thousands-separator
- THOUSEP)
+ THOUSEP "")
(define* (number->locale-string number
#:optional (fraction-digits #t)
@@ -402,9 +408,9 @@ number of fractional digits to be displayed."
;;;
(define-simple-langinfo-mapping locale-yes-regexp
- YESEXPR)
+ YESEXPR "^[yY]")
(define-simple-langinfo-mapping locale-no-regexp
- NOEXPR)
+ NOEXPR "^[nN]")
;; `YESSTR' and `NOSTR' are considered deprecated so we don't provide them.
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.5-23-ge7f7691,
Ludovic Courtès <=