aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog22
-rw-r--r--src/interp/c-util.boot2
-rw-r--r--src/interp/compiler.boot2
-rw-r--r--src/interp/database.boot2
-rw-r--r--src/interp/debug.lisp6
-rw-r--r--src/interp/format.boot15
-rw-r--r--src/interp/g-timer.boot2
-rw-r--r--src/interp/ht-util.boot6
-rw-r--r--src/interp/i-syscmd.boot16
-rw-r--r--src/interp/macros.lisp2
-rw-r--r--src/interp/monitor.lisp12
-rw-r--r--src/interp/msgdb.boot2
-rw-r--r--src/interp/newfort.boot4
-rw-r--r--src/interp/nlib.lisp4
-rw-r--r--src/interp/parsing.lisp2
-rw-r--r--src/interp/pf2atree.boot6
-rw-r--r--src/interp/pf2sex.boot6
-rw-r--r--src/interp/posit.boot4
-rw-r--r--src/interp/sfsfun.boot2
-rw-r--r--src/interp/util.lisp6
20 files changed, 71 insertions, 52 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d2b5716b..c39db1ff 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,27 @@
2012-05-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/c-util.boot: Miscellaneous cleanup.
+ * interp/compiler.boot: Likewise.
+ * interp/database.boot: Likewise.
+ * interp/debug.lisp: Likewise.
+ * interp/format.boot: Likewise.
+ * interp/g-timer.boot: Likewise.
+ * interp/ht-util.boot: Likewise.
+ * interp/i-syscmd.boot: Likewise.
+ * interp/macros.lisp: Likewise.
+ * interp/monitor.lisp: Likewise.
+ * interp/msgdb.boot: Likewise.
+ * interp/newfort.boot: Likewise.
+ * interp/nlib.lisp: Likewise.
+ * interp/parsing.lisp: Likewise.
+ * interp/pf2atree.boot: Likewise.
+ * interp/pf2sex.boot: Likewise.
+ * interp/posit.boot: Likewise.
+ * interp/sfsfun.boot: Likewise.
+ * interp/util.lisp: Likewise.
+
+2012-05-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/io.boot (findString): New.
* interp/preparse.lisp: Use it instead of SEARCH.
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 72a75537..b0ecbb73 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1742,7 +1742,7 @@ backendCompile1 x ==
-- Note that category constructors are evaluated before they
-- their compiled, so this noise is not very helpful.
if $verbose and FBOUNDP fname then
- FORMAT(true,'"~&~%;;; *** ~S REDEFINED~%",fname)
+ formatToStdout('"~&~%;;; *** ~S REDEFINED~%",fname)
[[fname,lamex],:$CLOSEDFNS]
backendCompile l ==
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index ed256368..2693906b 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -2806,7 +2806,7 @@ compileParseTree pt ==
pf = nil => nil -- stop if preprocessing was a disaster.
-- Don't go further if only preprocessing was requested.
$PrintOnly =>
- FORMAT(true,'"~S =====>~%",$currentLine)
+ formatToStdout('"~S =====>~%",$currentLine)
PRETTYPRINT pf
-- Now start actual compilation.
$x: local := nil -- ???
diff --git a/src/interp/database.boot b/src/interp/database.boot
index 8ba828f8..3dbcdb96 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -51,7 +51,7 @@ pathToDatabase name ==
if dbdir := systemDatabaseDirectory() then
path := strconc(dbdir,name)
if $verbose then
- FORMAT(true,'" Using local database ~a..",path)
+ formatToStdout('" Using local database ~a..",path)
else
path := strconc(systemRootDirectory(),'"algebra/",name)
path
diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp
index 21bacd14..6ece9a85 100644
--- a/src/interp/debug.lisp
+++ b/src/interp/debug.lisp
@@ -237,7 +237,7 @@
DEF ) ) )
( 'T
(let* ((mode-line (read-line inputstream))
- (pacpos (search "package:" mode-line :test #'equalp))
+ (pacpos (|findString| "package:" mode-line))
(endpos (search "-*-" mode-line :from-end t))
(*package* *package*)
(newpac nil))
@@ -1054,8 +1054,8 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|))
(defun SPADSYSNAMEP (STR)
(let (n i j)
(AND (SETQ N (|maxIndex| STR))
- (SETQ I (position #\. STR :start 1))
- (SETQ J (position #\, STR :start (1+ I)))
+ (SETQ I (|findChar| #\. STR 1))
+ (SETQ J (|findChar| #\, STR (1+ I)))
(do ((k (1+ j) (1+ k)))
((> k n) t)
(if (not (digitp (elt str k))) (return nil))))))
diff --git a/src/interp/format.boot b/src/interp/format.boot
index 41033b90..e46fbdac 100644
--- a/src/interp/format.boot
+++ b/src/interp/format.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2011, Gabriel Dos Reis.
+-- Copyright (C) 2007-2012, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -453,7 +453,7 @@ formWrapId id ==
$formatSigAsTeX = 1 => PNAME id
$formatSigAsTeX = 2 =>
sep := '"`"
- FORMAT(nil,'"\verb~a~a~a",sep, id, sep)
+ formatToString('"\verb~a~a~a",sep, id, sep)
error '"Bad formatSigValue"
formArguments2String(argl,ml) == [fn(x,m) for x in argl for m in ml] where
@@ -659,7 +659,7 @@ application2String(op,argl, linkInfo) ==
concat('"(",concat(tuple2String argl,'")")))
app2StringConcat0(x,y) ==
- FORMAT(nil, '"~a ~a", x, y)
+ formatToString('"~a ~a", x, y)
app2StringWrap(string, linkInfo) ==
not linkInfo => string
@@ -667,8 +667,7 @@ app2StringWrap(string, linkInfo) ==
$formatSigAsTeX = 2 =>
str2 := "app2StringConcat0"/form2Fence linkInfo
sep := '"`"
- FORMAT(nil, '"\lispLink{\verb!(|conPage| '~a)!}{~a}",
- str2, string)
+ formatToString('"\lispLink{\verb!(|conPage| '~a)!}{~a}", str2, string)
error "Bad value for $formatSigAsTeX"
record2String x ==
@@ -789,14 +788,14 @@ form2Fence form ==
form2Fence1 x ==
x is [op,:argl] =>
op = 'QUOTE => ['"(QUOTE ",:form2FenceQuote first argl,'")"]
- ['"(", FORMAT(nil, '"|~a|", op),:"append"/[form2Fence1 y for y in argl],'")"]
+ ['"(", formatToString('"|~a|", op),:"append"/[form2Fence1 y for y in argl],'")"]
null x => '""
- ident? x => FORMAT(nil, '"|~a|", x)
+ ident? x => formatToString('"|~a|", x)
['" ", x]
form2FenceQuote x ==
integer? x => [toString x]
- symbol? x => [FORMAT(nil, '"|~a|", x)]
+ symbol? x => [formatToString('"|~a|", x)]
string? x => ['"_"",x,'"_""]
x isnt [.,:.] => systemErrorHere ["form2FenceQuote",x]
['"(",:form2FenceQuote first x,:form2FenceQuoteTail rest x]
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot
index a93d01e1..a6608432 100644
--- a/src/interp/g-timer.boot
+++ b/src/interp/g-timer.boot
@@ -98,7 +98,7 @@ normalizeStatAndStringify t ==
float? t =>
t := roundStat t
t = 0.0 => '"0"
- FORMAT(nil,'"~,2F",t)
+ formatToString('"~,2F",t)
integer? t =>
K := 1024
M := K*K
diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot
index 1117be20..6fb2998c 100644
--- a/src/interp/ht-util.boot
+++ b/src/interp/ht-util.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2011, Gabriel Dos Reis.
+-- Copyright (C) 2007-2012, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -400,8 +400,8 @@ htMakeTemplates(templateList, numLabels) ==
template
templateParts template ==
- null string? template => template
- i := SEARCH('"%l", template)
+ not string? template => template
+ i := findString('"%l", template)
null i => template
[subSequence(template, 0, i), : subSequence(template, i+2)]
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index 611a3db6..63cda3aa 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -2772,7 +2772,7 @@ doSystemCommand string ==
handleNoParseCommands(unab, string) ==
string := stripSpaces string
- spaceIndex := SEARCH('" ", string)
+ spaceIndex := findChar(char " ", string)
unab is "lisp" =>
if (null spaceIndex) then
sayKeyedMsg("S2IV0005", nil)
@@ -2805,9 +2805,9 @@ handleNoParseCommands(unab, string) ==
npboot str ==
sex := string2BootTree str
- FORMAT(true, '"~&~S~%", sex)
+ formatToStdout('"~&~S~%", sex)
$ans := eval sex
- FORMAT(true, '"~&Value = ~S~%", $ans)
+ formatToStdout('"~&Value = ~S~%", $ans)
stripLisp str ==
found := false
@@ -2821,16 +2821,16 @@ stripLisp str ==
nplisp str ==
$ans := eval READ_-FROM_-STRING str
- FORMAT(true, '"~&Value = ~S~%", $ans)
+ formatToStdout('"~&Value = ~S~%", $ans)
npsystem(unab, str) ==
- spaceIndex := SEARCH('" ", str)
+ spaceIndex := findChar(char " ", str)
null spaceIndex =>
sayKeyedMsg('"S2IZ0080", [str])
sysPart := subSequence(str, 0, spaceIndex)
-- The following is a hack required by the fact that unAbbreviateKeyword
-- returns the word "system" for unknown words
- null SEARCH(sysPart, STRING unab) =>
+ null findString(sysPart, STRING unab) =>
sayKeyedMsg('"S2IZ0080", [sysPart])
command := subSequence(str, spaceIndex+1)
runCommand command
@@ -2902,7 +2902,7 @@ handleParsedSystemCommands(unabr, optionList) ==
systemCommand parcmd
parseSystemCmd opt ==
- spaceIndex := SEARCH('" ", opt)
+ spaceIndex := findChar(char " ", opt)
spaceIndex =>
commandString := stripSpaces subSequence(opt, 0, spaceIndex)
argString := stripSpaces subSequence(opt, spaceIndex)
@@ -2923,7 +2923,7 @@ handleTokensizeSystemCommands(unabr, optionList) ==
parcmd => tokenSystemCommand(unabr, parcmd)
getFirstWord string ==
- spaceIndex := SEARCH('" ", string)
+ spaceIndex := findChar(char " ", string)
null spaceIndex => string
stripSpaces subSequence(string, 0, spaceIndex)
diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp
index e431b682..69959807 100644
--- a/src/interp/macros.lisp
+++ b/src/interp/macros.lisp
@@ -507,7 +507,7 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size
(defun |breakIntoLines| (str)
(let ((bol 0) (eol) (line-list nil))
(loop
- (setq eol (position #\Newline str :start bol))
+ (setq eol (|findChar| #\Newline str bol))
(if (null eol) (return))
(if (> eol bol)
(setq line-list (cons (subseq str bol eol) line-list)))
diff --git a/src/interp/monitor.lisp b/src/interp/monitor.lisp
index 167342cc..075fd0ce 100644
--- a/src/interp/monitor.lisp
+++ b/src/interp/monitor.lisp
@@ -1,6 +1,6 @@
;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
;; All rights reserved.
-;; Copyright (C) 2007-2008, Gabriel Dos Reis.
+;; Copyright (C) 2007-2012, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -428,11 +428,11 @@
(defun monitor-parse (expr)
(let (point1 point2)
- (setq point1 (position #\space expr :test #'char=))
+ (setq point1 (|findChar| #\space expr))
(setq point1 (position #\space expr :start point1 :test-not #'char=))
- (setq point1 (position #\space expr :start point1 :test #'char=))
+ (setq point1 (|findChar| #\space expr point1))
(setq point1 (position #\space expr :start point1 :test-not #'char=))
- (setq point2 (position #\space expr :start point1 :test #'char=))
+ (setq point2 (|findChar| #\space expr point1))
(subseq expr point1 point2)))
(defun monitor-spadfile (name)
@@ -467,9 +467,7 @@
(maphash
#'(lambda (k v)
(when
- (search (string-upcase str)
- (string-upcase (symbol-name k))
- :test #'string=)
+ (|findString| (string-upcase str) (string-upcase (symbol-name k)))
(push v result)))
*monitor-table*)
result))
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index 6e46b830..052afa9d 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -330,7 +330,7 @@ cleanUpSegmentedMsg msg ==
msg1
operationLink name ==
- FORMAT(nil, '"\lispLink{\verb!(|oSearch| _"~a_")!}{~a}",
+ formatToString('"\lispLink{\verb!(|oSearch| _"~a_")!}{~a}",
name,
escapeSpecialChars STRINGIMAGE name)
diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot
index b4d23b8a..32ece73c 100644
--- a/src/interp/newfort.boot
+++ b/src/interp/newfort.boot
@@ -868,8 +868,8 @@ checkPrecision e ==
string? e and codePoint stringChar(e,0) = 34 => e
e := removeCharFromString(char " ",STRINGIMAGE e)
$fortranPrecision = "double" =>
- iPart := subSequence(e,0,(period:=POSITION(char ".",e))+1)
- expt := if ePos := POSITION(char "E",e) then subSequence(e,ePos+1) else "0"
+ iPart := subSequence(e,0,(period:=findChar(char ".",e))+1)
+ expt := if ePos := findChar(char "E",e) then subSequence(e,ePos+1) else "0"
rPart :=
ePos => subSequence(e,period+1,ePos)
period+1 < # e => subSequence(e,period+1)
diff --git a/src/interp/nlib.lisp b/src/interp/nlib.lisp
index 4ee13797..338ae9bd 100644
--- a/src/interp/nlib.lisp
+++ b/src/interp/nlib.lisp
@@ -1,6 +1,6 @@
;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
;; All rights reserved.
-;; Copyright (C) 2007-2010, Gabriel Dos Reis.
+;; Copyright (C) 2007-2012, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -239,7 +239,7 @@
(defun spad-fixed-arg (fname )
(and (equal (symbol-package fname) (find-package "BOOT"))
(not (get fname 'compiler::spad-var-arg))
- (search ";" (symbol-name fname))
+ (|findChar| #\; (symbol-name fname))
(or (get fname 'compiler::fixed-args)
(setf (get fname 'compiler::fixed-args) t)))
nil)
diff --git a/src/interp/parsing.lisp b/src/interp/parsing.lisp
index aa53480a..658286e7 100644
--- a/src/interp/parsing.lisp
+++ b/src/interp/parsing.lisp
@@ -296,7 +296,7 @@ the stack, then stack a NIL. Return the value of prod."
(go top)))
(defun termchr () "Is CHR a terminating character?"
- (position (|currentChar|) " *,;<>()[]/\\"))
+ (|findChar| (|currentChar|) " *,;<>()[]/\\"))
(defun compfin () (or (|matchString| ")fin") (|matchString| ".FIN")))
diff --git a/src/interp/pf2atree.boot b/src/interp/pf2atree.boot
index d368e2fc..a3ea8e70 100644
--- a/src/interp/pf2atree.boot
+++ b/src/interp/pf2atree.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2011, Gabriel Dos Reis.
+-- Copyright (C) 2007-2012, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -415,12 +415,12 @@ pfSequence2Atree0(seqList, pf) ==
--
-- float2Atree num ==
--- eIndex := SEARCH('"e", num)
+-- eIndex := findChar(char "e", num)
-- mantPart :=
-- eIndex => subSequence(num, 0, eIndex)
-- num
-- expPart := (eIndex => READ_-FROM_-STRING subSequence(num, eIndex+1); 0)
--- dotIndex := SEARCH('".", mantPart)
+-- dotIndex := findChar(char ".", mantPart)
-- intPart :=
-- dotIndex => READ_-FROM_-STRING subSequence(mantPart, 0, dotIndex)
-- READ_-FROM_-STRING mantPart
diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot
index 232a004a..ecd19406 100644
--- a/src/interp/pf2sex.boot
+++ b/src/interp/pf2sex.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2011, Gabriel Dos Reis.
+-- Copyright (C) 2007-2012, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -383,12 +383,12 @@ pfSequence2Sex0 seqList ==
["SEQ", :reverse! seqTranList]
float2Sex num ==
- eIndex := SEARCH('"e", num)
+ eIndex := findChar(char "e", num)
mantPart :=
eIndex => subSequence(num, 0, eIndex)
num
expPart := (eIndex => READ_-FROM_-STRING subSequence(num, eIndex+1); 0)
- dotIndex := SEARCH('".", mantPart)
+ dotIndex := findChar(char ".", mantPart)
intPart :=
dotIndex => READ_-FROM_-STRING subSequence(mantPart, 0, dotIndex)
READ_-FROM_-STRING mantPart
diff --git a/src/interp/posit.boot b/src/interp/posit.boot
index 05679001..c1d46fda 100644
--- a/src/interp/posit.boot
+++ b/src/interp/posit.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2011, Gabriel Dos Reis.
+-- Copyright (C) 2007-2012, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -242,6 +242,6 @@ pfPrintSrcLines(pf) ==
for l in lines repeat
line := first l
if lno < lnGlobalNum(line) then
- FORMAT(true, '" ~A~%", lnString line)
+ formatToStdout('" ~A~%", lnString line)
lno := lnGlobalNum(line)
diff --git a/src/interp/sfsfun.boot b/src/interp/sfsfun.boot
index f1cba953..1ccba154 100644
--- a/src/interp/sfsfun.boot
+++ b/src/interp/sfsfun.boot
@@ -72,7 +72,7 @@ namespace BOOT
FloatError(formatstring,arg) ==
-- ERROR(formatstring,arg)
- ERROR FORMAT([],formatstring,arg)
+ ERROR formatToString(formatstring,arg)
nangenericcomplex () ==
COMPLEX NaNQ()
diff --git a/src/interp/util.lisp b/src/interp/util.lisp
index 9c103e5e..4132d434 100644
--- a/src/interp/util.lisp
+++ b/src/interp/util.lisp
@@ -1,6 +1,6 @@
;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
;; All rights reserved.
-;; Copyright (C) 2007-2011, Gabriel Dos Reis.
+;; Copyright (C) 2007-2012, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,7 @@
;; of the information in an NRLIB is now kept in the daase files. Thus
;; we lift the FOO.NRLIB/code.o to FOO.o in the final system.
(defun lift-NRLIB-name (f)
- (|runCommand| (concat "cp " f "/code.o " (subseq f 0 (position #\. f)) ".o"))
+ (|runCommand| (concat "cp " f "/code.o " (subseq f 0 (|findChar| #\. f)) ".o"))
nil)
;; Translate a directory of boot code to common lisp if the boot code
@@ -429,7 +429,7 @@
(when (eq expr 'done) (throw 'done nil))
(when (and (> (length expr) 4)
(string= ")abb" (subseq expr 0 4))
- (search nrlib expr :test #'string=)
+ (|findString| nrlib expr)
(setq start (position #\space expr :from-end t :test #'char=)))
(throw 'done (string-trim '(#\space) (subseq expr start)))))))))
(SRCABBREVS (sourcefile)