aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-05 11:36:37 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-05 11:36:37 +0000
commitfb3bb6231462cddfb70301ea1672ebc04c8e829a (patch)
tree316e516bc5f0920f407fdae6e54780cdbdd320f2
parent94c6cd6e946964b3710dbe24dbca7c44a36beee0 (diff)
downloadopen-axiom-fb3bb6231462cddfb70301ea1672ebc04c8e829a.tar.gz
more cleanups
-rw-r--r--src/boot/strap/translator.clisp4
-rw-r--r--src/boot/translator.boot2
-rw-r--r--src/interp/clam.boot8
-rw-r--r--src/interp/sys-globals.boot9
-rw-r--r--src/lisp/core.lisp.in17
5 files changed, 24 insertions, 16 deletions
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index 3ad025ec..7c48e9fe 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -1138,7 +1138,7 @@
(DEFUN |shoeXref| (|a| |fn|)
(PROG (|$bfClamming| |$GenVarCounter| |$bootUsed| |$bootDefined|
- |$lispWordTable| |out|)
+ |$lispWordTable| |stream| |out|)
(DECLARE (SPECIAL |$bfClamming| |$GenVarCounter| |$bootUsed|
|$bootDefined| |$lispWordTable|))
(RETURN
@@ -1154,7 +1154,7 @@
(SETQ |out| (CONCAT |fn| ".xref"))
(UNWIND-PROTECT
(PROGN
- (SETQ |out| (|outputTextFile| |out|))
+ (SETQ |stream| (|outputTextFile| |out|))
(|shoeXReport| |stream|)
|out|)
(|closeFile| |stream|)))))))
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index 2ec71dfc..d52ead6c 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -651,7 +651,7 @@ shoeXref(a,fn)==
shoeDefUse shoeTransformStream a
out := strconc(fn,'".xref")
try
- out := outputTextFile out
+ stream := outputTextFile out
shoeXReport stream
out
finally closeFile stream
diff --git a/src/interp/clam.boot b/src/interp/clam.boot
index cf45340d..994d882d 100644
--- a/src/interp/clam.boot
+++ b/src/interp/clam.boot
@@ -321,8 +321,8 @@ CDRwithIncrement x ==
x.first := first x + 1
rest x
-HGETandCount(hashTable,prop) ==
- u:= HGET(hashTable,prop) or return nil
+HGETandCount(ht,prop) ==
+ u:= HGET(ht,prop) or return nil
u.first := first u + 1
u
@@ -402,8 +402,8 @@ mkCircularCountAlist(cl,len) ==
reportHashCacheStats fn ==
infovec:= property(fn,'cacheInfo)
- hashTable:= eval infovec.cacheName
- hashValues:= [HGET(hashTable,key) for key in HKEYS hashTable]
+ ht := eval infovec.cacheName
+ hashValues:= [HGET(ht,key) for key in HKEYS ht]
sayBrightly [:bright fn,'"has",:bright(# hashValues),'"values cached."]
displayCacheFrequency mkHashCountAlist hashValues
TERPRI()
diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot
index b956bfdf..c2e13a16 100644
--- a/src/interp/sys-globals.boot
+++ b/src/interp/sys-globals.boot
@@ -449,15 +449,6 @@ $formulaOutputStream :=
conOutStream :=
MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
-$InputStream :=
- MAKE_-SYNONYM_-STREAM "*STANDARD-INPUT*"
-
-$OutputStream :=
- MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
-
-$ErrorStream :=
- MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
-
--%
++ True if we are building the system algebra.
diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in
index 164b13e6..d4bf2df8 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -83,11 +83,16 @@
"%SimpleArray"
;; IO
+ "$InputStream"
+ "$OutputStream"
+ "$ErrorStream"
+
"inputBinaryFile"
"outputBinaryFile"
"inputTextFile"
"outputTextFile"
"closeFile"
+ "prettyPrint"
;; compiler data structures
"%Mode"
@@ -444,6 +449,11 @@
(t -1))))
;; -*- File IO -*-
+
+(defparameter |$InputStream| (make-synonym-stream '*standard-input*))
+(defparameter |$OutputStream| (make-synonym-stream '*standard-output*))
+(defparameter |$ErrorStream| (make-synonym-stream '*standard-output*))
+
(defun |inputBinaryFile| (f)
(open f
:direction :input
@@ -469,6 +479,13 @@
(defun |closeFile| (f)
(close f))
+
+;; Pretty-print a lisp form on a given output stream.
+(defun |prettyPrint| (x &optional (s |$OutputStream|))
+ (let ((*print-pretty* t)
+ (*print-array* t))
+ (prin1 x s)))
+
;;
;; -*- OpenAxiom filesystem -*-
;;