diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 15 | ||||
-rw-r--r-- | src/algebra/fortran.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/generic.spad.pamphlet | 6 | ||||
-rw-r--r-- | src/algebra/naalg.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/naalgc.spad.pamphlet | 6 | ||||
-rw-r--r-- | src/algebra/outform.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/strap/INT.lsp | 6 | ||||
-rw-r--r-- | src/algebra/strap/ISTRING.lsp | 10 | ||||
-rw-r--r-- | src/algebra/string.spad.pamphlet | 5 | ||||
-rw-r--r-- | src/interp/debug.lisp | 2 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 2 | ||||
-rw-r--r-- | src/interp/g-util.boot | 1 | ||||
-rw-r--r-- | src/interp/vmlisp.lisp | 6 |
13 files changed, 39 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 532ef386..fccf085c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2010-12-30 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/vmlisp.lisp (QSTRING): Remove. + (QSTRINGLENGTH): Likewise. + (STRINGLENGTH): Likewise. + * interp/g-opt.boot ($VMsideEffectFreeOperators): Include %i2s. + * interp/g-util.boot: Expand it. + * interp/debug.lisp (/LOCATE): Replace STRINGLENGTH with LENGTH. + * algebra/fortran.spad.pamphlet: Don't use STRINGIMAGE from Lisp. + * algebra/generic.spad.pamphlet: Likewise. + * algebra/naalg.spad.pamphlet: Likewise. + * algebra/naalgc.spad.pamphlet: Likewise. + * algebra/outform.spad.pamphlet: Likewise. + * algebra/string.spad.pamphlet: Likewise. + 2010-12-29 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/g-opt.boot ($VMsideEffectFreeOperators): Include %strlength. diff --git a/src/algebra/fortran.spad.pamphlet b/src/algebra/fortran.spad.pamphlet index 19d6bb87..59de4cb1 100644 --- a/src/algebra/fortran.spad.pamphlet +++ b/src/algebra/fortran.spad.pamphlet @@ -417,11 +417,11 @@ FortranCode(): public == private where cnt : O := "CONTINUE"::O --sp : O := hspace(6-width lab) sp : O := hspace(_$fortIndent$Lisp -width lab) - LIST(STRCONC(STRINGIMAGE(lab)$Lisp,sp,cnt)$Lisp)$Lisp + LIST(STRCONC(string(label)$String,sp,cnt)$Lisp)$Lisp getGoto(label:SingleInteger):SEX == fortran2Lines( - LIST(STRCONC("GOTO ",STRINGIMAGE(label::O)$Lisp)$Lisp)$Lisp)$Lisp + LIST(STRCONC("GOTO ",string(label)$String)$Lisp)$Lisp)$Lisp getRepeat(repRec:LOOP):SEX == sw : Switch := NOT elt(repRec,switch)$LOOP diff --git a/src/algebra/generic.spad.pamphlet b/src/algebra/generic.spad.pamphlet index 35d694d5..f25c87b4 100644 --- a/src/algebra/generic.spad.pamphlet +++ b/src/algebra/generic.spad.pamphlet @@ -153,7 +153,7 @@ GenericNonAssociativeAlgebra(R : CommutativeRing, n : PositiveInteger,_ private ==> AlgebraGivenByStructuralConstants(FPR,n,ls,_ coerce(gamma)$CoerceVectorMatrixPackage(R) ) add - listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] + listOfNumbers : List String := [string(q)$String for q in 1..n] symbolsForCoef : V Symbol := [concat("%", concat("x", i))::Symbol for i in listOfNumbers] genericElement : % := @@ -272,13 +272,13 @@ GenericNonAssociativeAlgebra(R : CommutativeRing, n : PositiveInteger,_ represents(map(coerce,v)$VectorFunctions2(PR,FPR),ve) generic(s: S, ve: V %): % == - lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] + lON : List String := [string(q)$String for q in 1..maxIndex ve] sFC : Vector Symbol := [concat(s pretend String, i)::Symbol for i in lON] generic(sFC, ve) generic(ve : V %) == - lON : List String := [STRINGIMAGE(q)$Lisp for q in 1..maxIndex ve] + lON : List String := [string(q)$String for q in 1..maxIndex ve] sFC : Vector Symbol := [concat("%", concat("x", i))::Symbol for i in lON] v : Vector PR := diff --git a/src/algebra/naalg.spad.pamphlet b/src/algebra/naalg.spad.pamphlet index 0ea33bb8..9993e0f9 100644 --- a/src/algebra/naalg.spad.pamphlet +++ b/src/algebra/naalg.spad.pamphlet @@ -179,7 +179,7 @@ AlgebraGivenByStructuralConstants(R:Field, n : PositiveInteger,_ -- conditionsForIdempotents b == -- n := rank() -- --gamma : Vector Matrix R := structuralConstants b --- listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] +-- listOfNumbers : List String := [string(q)$String for q in 1..n] -- symbolsForCoef : Vector Symbol := -- [concat("%", concat("x", i))::Symbol for i in listOfNumbers] -- conditions : List Polynomial R := [] diff --git a/src/algebra/naalgc.spad.pamphlet b/src/algebra/naalgc.spad.pamphlet index b68e779c..c256691a 100644 --- a/src/algebra/naalgc.spad.pamphlet +++ b/src/algebra/naalgc.spad.pamphlet @@ -571,7 +571,7 @@ FiniteRankNonAssociativeAlgebra(R:CommutativeRing): -- conditionsForIdempotents b == -- n := rank() -- gamma : Vector Matrix R := structuralConstants b - -- listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] + -- listOfNumbers : List String := [string(q)$String for q in 1..n] -- symbolsForCoef : Vector Symbol := -- [concat("%", concat("x", i))::Symbol for i in listOfNumbers] -- conditions : List Polynomial R := [] @@ -1019,7 +1019,7 @@ FramedNonAssociativeAlgebra(R:CommutativeRing): Category == _ n := rank() b := basis() gamma : Vector Matrix R := structuralConstants b - listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] + listOfNumbers : List String := [string(q)$String for q in 1..n] symbolsForCoef : Vector Symbol := [concat("%", concat("x", i))::Symbol for i in listOfNumbers] xx : M P R := new(1,n,0) @@ -1052,7 +1052,7 @@ FramedNonAssociativeAlgebra(R:CommutativeRing): Category == _ n := rank() b := basis() gamma : Vector Matrix R := structuralConstants b - listOfNumbers : List String := [STRINGIMAGE(q)$Lisp for q in 1..n] + listOfNumbers : List String := [string(q)$String for q in 1..n] symbolsForCoef : Vector Symbol := [concat("%", concat("x", i))::Symbol for i in listOfNumbers] xx : M P R := new(1,n,0) diff --git a/src/algebra/outform.spad.pamphlet b/src/algebra/outform.spad.pamphlet index de35766f..ff48d5e9 100644 --- a/src/algebra/outform.spad.pamphlet +++ b/src/algebra/outform.spad.pamphlet @@ -123,7 +123,7 @@ NumberFormats(): NFexports == NFimplementation where pren:C := char ")" ichar:C := char "I" - FormatArabic n == STRINGIMAGE(n)$Lisp + FormatArabic n == string(n)$String ScanArabic s == PARSE_-INTEGER(s)$Lisp FormatRoman pn == diff --git a/src/algebra/strap/INT.lsp b/src/algebra/strap/INT.lsp index f528d6be..32e4f83b 100644 --- a/src/algebra/strap/INT.lsp +++ b/src/algebra/strap/INT.lsp @@ -98,7 +98,7 @@ (DECLAIM (FTYPE (FUNCTION (|%Integer| |%Shell|) |%String|) |INT;convert;$S;26|)) -(PUT '|INT;convert;$S;26| '|SPADreplace| 'STRINGIMAGE) +(PUT '|INT;convert;$S;26| '|SPADreplace| '|%i2s|) (DECLAIM (FTYPE (FUNCTION (|%Integer| |%Shell|) |%String|) |INT;latex;$S;27|)) @@ -366,10 +366,10 @@ (DEFUN |INT;convert;$S;26| (|x| $) (DECLARE (IGNORE $)) - (STRINGIMAGE |x|)) + (WRITE-TO-STRING |x|)) (DEFUN |INT;latex;$S;27| (|x| $) - (LET ((|s| (STRINGIMAGE |x|))) + (LET ((|s| (WRITE-TO-STRING |x|))) (SEQ (COND ((< -1 |x|) (COND ((< |x| 10) (EXIT |s|))))) (EXIT (STRCONC "{" (STRCONC |s| "}")))))) diff --git a/src/algebra/strap/ISTRING.lsp b/src/algebra/strap/ISTRING.lsp index b6f386f0..60503702 100644 --- a/src/algebra/strap/ISTRING.lsp +++ b/src/algebra/strap/ISTRING.lsp @@ -187,7 +187,7 @@ (RETURN (LET ((|l| (- (SPADCALL |sg| (|getShellEntry| $ 44)) (|getShellEntry| $ 6))) - (|m| (QCSIZE |s|)) (|n| (QCSIZE |t|)) + (|m| (LENGTH |s|)) (|n| (LENGTH |t|)) (|h| (COND ((SPADCALL |sg| (|getShellEntry| $ 45)) (- (SPADCALL |sg| (|getShellEntry| $ 46)) @@ -515,12 +515,12 @@ ((ATOM #4#) (RETURN NIL)) (T (LET ((|s| (CAR #4#))) (SEQ (|ISTRING;copyInto!;2$I$;29| |t| |s| |i| $) - (EXIT (SETQ |i| (+ |i| (QCSIZE |s|)))))))) + (EXIT (SETQ |i| (+ |i| (LENGTH |s|)))))))) (SETQ #4# (CDR #4#)))) (EXIT |t|)))) (DEFUN |ISTRING;copyInto!;2$I$;29| (|y| |x| |s| $) - (LET ((|m| (SPADCALL |x| (|getShellEntry| $ 16))) (|n| (QCSIZE |y|))) + (LET ((|m| (SPADCALL |x| (|getShellEntry| $ 16))) (|n| (LENGTH |y|))) (SEQ (SETQ |s| (- |s| (|getShellEntry| $ 6))) (COND ((OR (MINUSP |s|) (< |n| (+ |s| |m|))) @@ -544,7 +544,7 @@ (T (- (SPADCALL |s| (|getShellEntry| $ 47)) (|getShellEntry| $ 6)))))) (SEQ (COND - ((OR (MINUSP |l|) (NOT (< |h| (QCSIZE |s|)))) + ((OR (MINUSP |l|) (NOT (< |h| (LENGTH |s|)))) (EXIT (|error| "index out of bound")))) (EXIT (SUBSTRING |s| |l| (MAX 0 (+ (- |h| |l|) 1))))))) @@ -625,7 +625,7 @@ (T (SEQ (SETQ |i| - (+ |i| (QCSIZE |s|))) + (+ |i| (LENGTH |s|))) (SETQ |p| |q|) (EXIT (SETQ |q| diff --git a/src/algebra/string.spad.pamphlet b/src/algebra/string.spad.pamphlet index baa4a99d..4c8ce1c5 100644 --- a/src/algebra/string.spad.pamphlet +++ b/src/algebra/string.spad.pamphlet @@ -492,8 +492,9 @@ String(): Public == Private where string: DoubleFloat -> % ++ \spad{string f} returns the decimal representation of ++ \spad{f} in a string - Private == IndexedString(MINSTRINGINDEX) add - string(n: Integer) == STRINGIMAGE(n)$Lisp + Private == IndexedString(MINSTRINGINDEX) add + import %i2s: Integer -> % from Foreign Builtin + string(n: Integer) == %i2s n string(f: DoubleFloat) == %f2s(f)$Foreign(Builtin) OMwrite(x: %): String == diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp index 3ed6ea3d..2c951e31 100644 --- a/src/interp/debug.lisp +++ b/src/interp/debug.lisp @@ -310,7 +310,7 @@ (NOT (make-input-filename INFILE))) (RETURN NIL)) (SETQ FT (UPCASE (|object2Identifier| (|pathnameType| INFILE)))) - (SETQ KEYLENGTH (STRINGLENGTH KEY)) + (SETQ KEYLENGTH (LENGTH KEY)) (WHEN (> INITRECNO 1) ;; we think we know where it is (POINT INITRECNO |$InputStream|) (SETQ LN (READ-LINE |$InputStream| NIL NIL)) diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index cd078397..a25c25a3 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -451,7 +451,7 @@ $VMsideEffectFreeOperators == %nil %pair? %lconcat %llength %lfirst %lsecond %lthird %lreverse %lempty? %hash %ismall? %string? %f2s %ccst %ceq %clt %cle %cgt %cge %c2i %i2c %s2c %sname - %strlength + %strlength %i2s %vref %vlength %before?) ++ List of simple VM operators diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 3a2504cf..b3e1d1ac 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -434,6 +434,7 @@ for x in [ ['%integer?,:'INTEGERP], ['%iodd?, :'ODDP], ['%ismall?, :'FIXNUMP], + ['%i2s, :'WRITE_-TO_-STRING], -- binary integer operations. ['%iadd, :"+"], ['%igcd, :'GCD], diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp index 696c8821..7845b25e 100644 --- a/src/interp/vmlisp.lisp +++ b/src/interp/vmlisp.lisp @@ -395,9 +395,6 @@ (defmacro qstimes (x y) `(the fixnum (* (the fixnum ,x) (the fixnum ,y)))) -(defmacro qstringlength (x) - `(the fixnum (length (the simple-string ,x)))) - (defmacro qszerop (x) `(zerop (the fixnum ,x))) @@ -449,9 +446,6 @@ (defmacro smintp (n) `(typep ,n 'fixnum)) -(defmacro stringlength (x) - `(length (the string ,x))) - (defmacro subrp (x) `(compiled-function-p ,x)) |