aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2014-11-20 08:23:16 +0000
committerdos-reis <gdr@axiomatics.org>2014-11-20 08:23:16 +0000
commit6eb6cb046be4895a71869d26e9bb0baa8b46772f (patch)
tree29bd3c807ed0f83f0319d95ee5fcf96615898b7b
parentbb531c8db7a41f93f647f354e29d0e33d1377796 (diff)
downloadopen-axiom-6eb6cb046be4895a71869d26e9bb0baa8b46772f.tar.gz
Remove EOFP. Simplify IO file stream creation code.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/algebra/files.spad.pamphlet3
-rw-r--r--src/interp/br-data.boot4
-rw-r--r--src/interp/topics.boot4
-rw-r--r--src/interp/vmlisp.lisp10
5 files changed, 17 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4745403d..ae042707 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2014-11-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * algebra/files.spad.pamphlet (endOfFile?)[TextFile]: Use builtin eof?
+ * interp/br-data.boot (dbAugmentConstructorDataTable): Likewise.
+ * interp/topics.boot (mkTopicHashTable): Likewise.
+ * interp/vmlisp.lisp (MAKE-INSTREAM): Use inputTextFile.
+ (MAKE-OUTSTREAM): Use outputTextFile.
+ (EOFP): Remove.
+
2014-11-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
* boot/bemol.cc: New.
diff --git a/src/algebra/files.spad.pamphlet b/src/algebra/files.spad.pamphlet
index e379d003..f09fbae3 100644
--- a/src/algebra/files.spad.pamphlet
+++ b/src/algebra/files.spad.pamphlet
@@ -272,8 +272,7 @@ TextFile: Cat == Def where
x
endOfFile? f ==
f.fileIOmode = "output" => false
- (EOFP(f.fileState)$Lisp pretend Boolean) => true
- false
+ eof?(f.fileState)$Lisp
@
diff --git a/src/interp/br-data.boot b/src/interp/br-data.boot
index 3c44428f..0b761a15 100644
--- a/src/interp/br-data.boot
+++ b/src/interp/br-data.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2012, Gabriel Dos Reis.
+-- Copyright (C) 2007-2014, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -221,7 +221,7 @@ buildLibAttr(name,argl,pred) ==
dbAugmentConstructorDataTable() ==
instream := MAKE_-INSTREAM '"libdb.text"
- while not EOFP instream repeat
+ while not eof? instream repeat
fp := FILE_-POSITION instream
line := readLine instream
cname := makeSymbol dbName line
diff --git a/src/interp/topics.boot b/src/interp/topics.boot
index 981b3657..860a8ab4 100644
--- a/src/interp/topics.boot
+++ b/src/interp/topics.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2012, Gabriel Dos Reis.
+-- Copyright (C) 2007-2014, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -92,7 +92,7 @@ mkTopicHashTable() == --given $groupAssoc = ((extended .
tableValue($defaultsHash,item) := [kind,:tableValue($defaultsHash,item)]
$conTopicHash := hashTable 'EQL --key is constructor name; value is
instream := inputTextFile '"topics.data"
- while not EOFP instream repeat
+ while not eof? instream repeat
line := readLine instream
while blankLine? line repeat line := readLine instream
m := maxIndex line --file "topics.data" has form:
diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp
index 68735213..cbb6de78 100644
--- a/src/interp/vmlisp.lisp
+++ b/src/interp/vmlisp.lisp
@@ -1,6 +1,6 @@
;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
;; All rights reserved.
-;; Copyright (C) 2007-2013, Gabriel Dos Reis.
+;; Copyright (C) 2007-2014, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -914,15 +914,13 @@
(declare (ignore recnum))
(cond ((numberp filespec) (make-synonym-stream '*standard-input*))
((null filespec) (error "not handled yet"))
- (t (open (|makeInputFilename| filespec)
- :direction :input :if-does-not-exist nil))))
+ (t (|inputTextFile| (|makeInputFilename| filespec)))))
(defun MAKE-OUTSTREAM (filespec &optional (width nil) (recnum 0))
(declare (ignore width) (ignore recnum))
(cond ((numberp filespec) (make-synonym-stream '*standard-output*))
((null filespec) (error "not handled yet"))
- (t (open (|makeFilename| filespec) :direction :output
- :if-exists :supersede))))
+ (t (|outputTextFile| (|makeFilename| filespec)))))
(defun MAKE-APPENDSTREAM (filespec &optional (width nil) (recnum 0))
"fortran support"
@@ -954,8 +952,6 @@
(defun shut (st) (if (|ioTerminal?| st) st
(if (streamp st) (close st) -1)))
-(defun EOFP (stream) (null (peek-char nil stream nil nil)))
-
; 28.0 Key addressed I/O