add #:resolve-syntax-parameters? kwarg to syntax-local-binding
[bpt/guile.git] / module / srfi / srfi-6.scm
1 ;;; srfi-6.scm --- Basic String Ports
2
3 ;; Copyright (C) 2001, 2002, 2003, 2006, 2012 Free Software Foundation, Inc.
4 ;;
5 ;; This library is free software; you can redistribute it and/or
6 ;; modify it under the terms of the GNU Lesser General Public
7 ;; License as published by the Free Software Foundation; either
8 ;; version 3 of the License, or (at your option) any later version.
9 ;;
10 ;; This library is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;; Lesser General Public License for more details.
14 ;;
15 ;; You should have received a copy of the GNU Lesser General Public
16 ;; License along with this library; if not, write to the Free Software
17 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19 ;;; Commentary:
20
21 ;; This module is fully documented in the Guile Reference Manual.
22
23 ;;; Code:
24
25 (define-module (srfi srfi-6)
26 #:replace (open-input-string open-output-string)
27 #:re-export (get-output-string))
28
29 ;; SRFI-6 says nothing about encodings, and assumes that any character
30 ;; or string can be written to a string port. Thus, make all SRFI-6
31 ;; string ports Unicode capable. See <http://bugs.gnu.org/11197>.
32
33 (define (open-input-string s)
34 (with-fluids ((%default-port-encoding "UTF-8"))
35 ((@ (guile) open-input-string) s)))
36
37 (define (open-output-string)
38 (with-fluids ((%default-port-encoding "UTF-8"))
39 ((@ (guile) open-output-string))))
40
41 (cond-expand-provide (current-module) '(srfi-6))
42
43 ;;; srfi-6.scm ends here