1
#| rep.io.streams bootstrap
3
$Id: streams.jl,v 1.3 2000/08/16 10:54:04 john Exp $
5
Copyright (C) 2000 John Harper <john@dcs.warwick.ac.uk>
7
This file is part of librep.
9
librep is free software; you can redistribute it and/or modify it
10
under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2, or (at your option)
14
librep is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with librep; see the file COPYING. If not, write to
21
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
(declare (in-module rep.io.streams))
26
(open-structures '(rep.lang.symbols
29
;; Setup format-hooks-alist to a few default'ish things
30
(defvar format-hooks-alist '((?D . file-name-directory)
31
(?F . file-name-nondirectory)))
33
(defun prin1-to-string (arg)
34
"Return a string representing ARG."
35
(format nil "%S" arg))
37
(defun read-from-string (string #!optional start)
38
"Reads an object from STRING, starting at character number START (default
40
(read (make-string-input-stream string start)))
43
"Returns true if ARG is some sort of I/O stream."
44
(or (input-stream-p arg) (output-stream-p arg)))
46
(export-bindings '(prin1-to-string read-from-string streamp))