1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

fix bugs in ice-9 i18n demo (invalid input)

* doc/ref/api-i18n.texi (Accessing Locale Information): Crucial
  bugfixes.
This commit is contained in:
Andy Wingo 2010-04-15 23:24:26 +02:00
parent 4d0fd3467c
commit 698307a08a

View file

@ -450,14 +450,17 @@ For the C locale, the default values are typically @code{"^[yY]"} and
Here is an example: Here is an example:
@example @example
(use-modules (ice-9 rdelim))
(format #t "Does Guile rock?~%") (format #t "Does Guile rock?~%")
(let ((answer (read-line))) (let lp ((answer (read-line)))
(cond ((string-match (locale-yes-regexp) answer) (cond ((string-match (locale-yes-regexp) answer)
"Yes it does.") (format #t "High fives!~%"))
((string-match (locale-no-regexp) answer) ((string-match (locale-no-regexp) answer)
"No it doesn't.") (format #t "How about now? Does it rock yet?~%")
(lp (read-line)))
(else (else
"What do you mean?"))) (format #t "What do you mean?~%")
(lp (read-line)))))
@end example @end example
For an internationalized yes/no string output, @code{gettext} should For an internationalized yes/no string output, @code{gettext} should