diff options
author | dos-reis <gdr@axiomatics.org> | 2011-05-29 00:58:58 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-05-29 00:58:58 +0000 |
commit | 05f1dbf1e8564c316a4e0ed7146b4991162f8875 (patch) | |
tree | c909542d73594a47898ed440a7e4f13c256d3f07 /src/algebra/files.spad.pamphlet | |
parent | f274326c2d4e1912fd99105ce72298684f5ee0ab (diff) | |
download | open-axiom-05f1dbf1e8564c316a4e0ed7146b4991162f8875.tar.gz |
* lisp/core.lisp.in (readExpr): New.
* interp/as.boot: Replace READLINE with readLine.
* interp/br-data.boot: Likewise.
* interp/br-saturn.boot: Likewise.
* interp/br-search.boot: Likewise.
* interp/c-doc.boot: Likewise.
* interp/cstream.boot: Likewise.
* interp/g-error.boot: Likewise.
* interp/ht-root.boot: Likewise.
* interp/htcheck.boot: Likewise.
* interp/i-syscmd.boot: Likewise.
* interp/msgdb.boot: Likewise.
* interp/server.boot: Likewise.
* interp/topics.boot: Likewise.
* interp/compat.boot (READLINE): Remove.
* interp/sys-macros.lisp (shoeConsole): Remove.
(shoeInputFile): Likewise.
(shoeread-line): Likewise.
* boot/ast.boot (bfQ): %nothing only needs EQ.
* algebra/files.spad.pamphlet (File) [read!, readIfCan!]: Use
readExpr instead of VMREAD. Avoid PLACEP
(TextFile) [readLine!, readLineIfCan!]: Likewise.
Diffstat (limited to 'src/algebra/files.spad.pamphlet')
-rw-r--r-- | src/algebra/files.spad.pamphlet | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/algebra/files.spad.pamphlet b/src/algebra/files.spad.pamphlet index 1e30c441..98543b32 100644 --- a/src/algebra/files.spad.pamphlet +++ b/src/algebra/files.spad.pamphlet @@ -172,16 +172,15 @@ File(S:SetCategory): FileCategory(FileName, S) with read! f == f.fileIOmode ~= "input" => error "File not in read state" - x := VMREAD(f.fileState)$Lisp - PLACEP(x)$Lisp => - error "End of file" - x + x: Maybe S := readExpr(f.fileState)$Foreign(Builtin) + x case nothing => error "End of file" + x@S readIfCan! f == f.fileIOmode ~= "input" => error "File not in read state" - x: S := VMREAD(f.fileState)$Lisp - PLACEP(x)$Lisp => "failed" - x + x: Maybe S := readExpr(f.fileState)$Foreign(Builtin) + x case nothing => "failed" + x@S write!(f, x) == f.fileIOmode ~= "output" => error "File not in write state" @@ -251,14 +250,14 @@ TextFile: Cat == Def where readLine! f == f.fileIOmode ~= "input" => error "File not in read state" - s: String := read_-line(f.fileState)$Lisp - PLACEP(s)$Lisp => error "End of file" - s + s: Maybe String := readLine(f.fileState)$Foreign(Builtin) + s case String => s + error "End of file" readLineIfCan! f == f.fileIOmode ~= "input" => error "File not in read state" - s: String := read_-line(f.fileState)$Lisp - PLACEP(s)$Lisp => "failed" - s + s: Maybe String := readLine(f.fileState)$Foreign(Builtin) + s case String => s@String + "failed" write!(f, x) == f.fileIOmode ~= "output" => error "File not in write state" PRINTEXP(x, f.fileState)$Lisp |