diff options
author | dos-reis <gdr@axiomatics.org> | 2010-12-19 16:04:55 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-12-19 16:04:55 +0000 |
commit | 0baf7a71d80fc15fdab5caa551b7e00800dccbef (patch) | |
tree | 859d6581ba133d0123a27d7e82f0c64b5aea46bc /src | |
parent | ba495f17f8e3a8b780f038fd6f2d5877ccc2476e (diff) | |
download | open-axiom-0baf7a71d80fc15fdab5caa551b7e00800dccbef.tar.gz |
* interp/vmlisp.lisp (VECP): Remove.
(REFVECP): Likewise.
(CVECP): Likewise.
(QMEMQ): Likewise.
* interp/bootlex.lisp (TRANSLABEL1): Adjust.
* interp/br-search.boot: Likewise.
* interp/br-util.boot: Likewise.
* interp/c-doc.boot: Likewise.
* interp/category.boot: Likewise.
* interp/database.boot: Likewise.
* interp/debug.lisp: Likewise.
* interp/format.boot: Likewise.
* interp/functor.boot: Likewise.
* interp/g-cndata.boot: Likewise.
* interp/g-util.boot: Likewise.
* interp/ggreater.lisp: Likewise.
* interp/guess.boot: Likewise.
* interp/i-coerfn.boot: Likewise.
* interp/i-map.boot: Likewise.
* interp/i-output.boot: Likewise.
* interp/i-resolv.boot: Likewise.
* interp/i-spec2.boot: Likewise.
* interp/i-syscmd.boot: Likewise.
* interp/interop.boot: Likewise.
* interp/i-util.boot: Likewise.
* interp/union.lisp: Likewise.
* interp/trace.boot: Likewise.
* interp/pspad2.boot: Likewise.
* interp/pathname.boot: Likewise.
* interp/nrunopt.boot: Likewise.
* interp/nrunfast.boot: Likewise.
* interp/nruncomp.boot: Likewise.
* interp/newfort.boot: Likewise.
* interp/msgdb.boot: Likewise.
* interp/msg.boot: Likewise.
* interp/match.boot: Likewise.
* interp/word.boot: Likewise.
Diffstat (limited to 'src')
36 files changed, 152 insertions, 120 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2cbddc90..3f914bd7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,43 @@ +2010-12-19 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/vmlisp.lisp (VECP): Remove. + (REFVECP): Likewise. + (CVECP): Likewise. + (QMEMQ): Likewise. + * interp/bootlex.lisp (TRANSLABEL1): Adjust. + * interp/br-search.boot: Likewise. + * interp/br-util.boot: Likewise. + * interp/c-doc.boot: Likewise. + * interp/category.boot: Likewise. + * interp/database.boot: Likewise. + * interp/debug.lisp: Likewise. + * interp/format.boot: Likewise. + * interp/functor.boot: Likewise. + * interp/g-cndata.boot: Likewise. + * interp/g-util.boot: Likewise. + * interp/ggreater.lisp: Likewise. + * interp/guess.boot: Likewise. + * interp/i-coerfn.boot: Likewise. + * interp/i-map.boot: Likewise. + * interp/i-output.boot: Likewise. + * interp/i-resolv.boot: Likewise. + * interp/i-spec2.boot: Likewise. + * interp/i-syscmd.boot: Likewise. + * interp/interop.boot: Likewise. + * interp/i-util.boot: Likewise. + * interp/union.lisp: Likewise. + * interp/trace.boot: Likewise. + * interp/pspad2.boot: Likewise. + * interp/pathname.boot: Likewise. + * interp/nrunopt.boot: Likewise. + * interp/nrunfast.boot: Likewise. + * interp/nruncomp.boot: Likewise. + * interp/newfort.boot: Likewise. + * interp/msgdb.boot: Likewise. + * interp/msg.boot: Likewise. + * interp/match.boot: Likewise. + * interp/word.boot: Likewise. + 2010-12-18 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/translator.boot (BOOTTOCL): Replace Lisp-level contruct diff --git a/src/interp/bootlex.lisp b/src/interp/bootlex.lisp index 6c64abca..487de0e3 100644 --- a/src/interp/bootlex.lisp +++ b/src/interp/bootlex.lisp @@ -358,7 +358,7 @@ or the chracters ?, !, ' or %" (defun TRANSLABEL1 (X AL) "Transforms X according to AL = ((<label> . Sexpr) ..)." - (COND ((REFVECP X) + (COND ((simple-vector-p X) (do ((i 0 (1+ i)) (k (maxindex x))) ((> i k)) diff --git a/src/interp/br-search.boot b/src/interp/br-search.boot index e28d118c..6e68d9a6 100644 --- a/src/interp/br-search.boot +++ b/src/interp/br-search.boot @@ -280,7 +280,7 @@ mkGrepPattern1(x,:options) == --called by mkGrepPattern (and grepConstructName?) [SUBSTRING(s,i,f-i) while ((i := f + 1) <= max) and (f := charPosition(char,s,i))] charPosition(c,t,startpos) == --honors underscores - n := SIZE t + n := # t if startpos < 0 or startpos > n then error "index out of range" k:= startpos for i in startpos .. n-1 while c ~= t.i diff --git a/src/interp/br-util.boot b/src/interp/br-util.boot index 55d8776a..27c526da 100644 --- a/src/interp/br-util.boot +++ b/src/interp/br-util.boot @@ -123,7 +123,7 @@ escapeString com == --this makes changes on single comment lines -- was htexCom look := 0 while look repeat - look >= SIZE com => look := [] + look >= #com => look := [] look := STRPOSL ('"${}#%", com, look, []) diff --git a/src/interp/c-doc.boot b/src/interp/c-doc.boot index 5ccc98ce..12ec3898 100644 --- a/src/interp/c-doc.boot +++ b/src/interp/c-doc.boot @@ -768,13 +768,15 @@ checkDecorate u == x := first u if not verbatim then - if x = '"\em" then + if x is '"\em" then if count > 0 then mathSymbolsOk := count - 1 spadflag := count - 1 else checkDocError ['"\em must be enclosed in braces"] - if x in '("\spadpaste" "\spad" "\spadop") then mathSymbolsOk := count - if x in '("\s" "\spadtype" "\spadsys" "\example" "\andexample" "\spadop" "\spad" "\spadignore" "\spadpaste" "\spadcommand" "\footnote") then spadflag := count + if string? x and x in '("\spadpaste" "\spad" "\spadop") then + mathSymbolsOk := count + if string? x and x in '("\s" "\spadtype" "\spadsys" "\example" "\andexample" "\spadop" "\spad" "\spadignore" "\spadpaste" "\spadcommand" "\footnote") then + spadflag := count else if x = $charLbrace then count := count + 1 else if x = $charRbrace then @@ -786,37 +788,37 @@ checkDecorate u == checkDocError ["Symbol ",x,'" appearing outside \spad{}"] acc := - x = '"\end{verbatim}" => + x is '"\end{verbatim}" => verbatim := false [x, :acc] verbatim => [x, :acc] - x = '"\begin{verbatim}" => + x is '"\begin{verbatim}" => verbatim := true [x, :acc] - x = '"\begin" and first (v := IFCDR u) = $charLbrace and - first (v := IFCDR v) = '"detail" and first (v := IFCDR v) = $charRbrace + x is '"\begin" and first(v := IFCDR u) = $charLbrace and + first(v := IFCDR v) is '"detail" and first(v := IFCDR v) = $charRbrace => u := v ['"\blankline ",:acc] - x = '"\end" and first (v := IFCDR u) = $charLbrace and - first (v := IFCDR v) = '"detail" and first (v := IFCDR v) = $charRbrace + x is '"\end" and first(v := IFCDR u) = $charLbrace and + first(v := IFCDR v) is '"detail" and first(v := IFCDR v) = $charRbrace => u := v acc - x = char '_$ or x = '"$" => ['"\$",:acc] - x = char '_% or x = '"%" => ['"\%",:acc] - x = char '_, or x = '"," => + x = char '_$ or x is '"$" => ['"\$",:acc] + x = char '_% or x is '"%" => ['"\%",:acc] + x = char '_, or x is '"," => spadflag => ['",",:acc] ['",{}",:acc] - x = '"\spad" => ['"\spad",:acc] + x is '"\spad" => ['"\spad",:acc] string? x and digit? x.0 => [x,:acc] not spadflag and (CHARP x and alphabetic? x and not MEMQ(x,$charExclusions) or member(x,$argl)) => [$charRbrace,x,$charLbrace,'"\spad",:acc] - not spadflag and ((string? x and not x.0 = $charBack and digit?(x.(MAXINDEX x))) or x in '("true" "false")) => + not spadflag and string? x and ((x.0 ~= $charBack and digit?(x.(MAXINDEX x))) or x in '("true" "false")) => [$charRbrace,x,$charLbrace,'"\spad",:acc] --wrap x1, alpha3, etc - xcount := SIZE x + xcount := (string? x => # x; 0) xcount = 3 and x.1 = char 't and x.2 = char 'h => ['"th",$charRbrace,x.0,$charLbrace,'"\spad",:acc] xcount = 4 and x.1 = char '_- and x.2 = char 't and x.3 = char 'h => diff --git a/src/interp/category.boot b/src/interp/category.boot index 3ec61377..4d873c5b 100644 --- a/src/interp/category.boot +++ b/src/interp/category.boot @@ -408,7 +408,7 @@ JoinInner(l,$e) == if atom at2 then at2:=[at2] -- the variable $Attributes is built globally, so that true -- attributes can be detected without calling isCategoryForm - QMEMQ(first at2,$Attributes) => nil + MEMQ(first at2,$Attributes) => nil null isCategoryForm(at2,$e) => $Attributes:=[first at2,:$Attributes] nil @@ -513,7 +513,7 @@ JoinInner(l,$e) == then attl:= [[a,condition],:attl] else attl:= [[a,["and",condition,c]],:attl] if reallynew then - n:= SIZE $NewCatVec + n:= # $NewCatVec FundamentalAncestors:= [[b.0,condition,n],:FundamentalAncestors] $NewCatVec:= LENGTHENVEC($NewCatVec,n+1) -- We need to copy the vector otherwise the FundamentalAncestors diff --git a/src/interp/database.boot b/src/interp/database.boot index 00584999..43ca1697 100644 --- a/src/interp/database.boot +++ b/src/interp/database.boot @@ -706,7 +706,7 @@ dropPrefix(fn) == --++ egFiles := NIL --++ while (not PLACEP (x:= readLine stream)) repeat --++ x := DROPTRAILINGBLANKS x ---++ SIZE(x) = 0 => 'iterate -- blank line +--++ # x = 0 => 'iterate -- blank line --++ (x.0 = char "#") or (x.0 = char "*") => 'iterate -- comment --++ x.0 = char " " => --++ -- possible exposure group member name and library name @@ -719,7 +719,7 @@ dropPrefix(fn) == --++ throwKeyedMsg("S2IZ0069B",[namestring egFile,x]) --++ n := object2Identifier SUBSTRING(x,0,p) --++ x := dropLeadingBlanks SUBSTRING(x,p+1,NIL) ---++ SIZE(x) = 0 => +--++ # x = 0 => --++ throwKeyedMsg("S2IZ0069B",[namestring egFile,x]) --++ egFiles := [[n,:object2Identifier x],:egFiles] --++ -- have a new group name diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp index 0f195922..3ed6ea3d 100644 --- a/src/interp/debug.lisp +++ b/src/interp/debug.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-2010, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -828,7 +828,7 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|)) (DEFUN SMALL-ENOUGH-COUNT (X N M) "Returns number if number of nodes < M otherwise nil." (COND ((< M N) NIL) - ((VECP X) + ((simple-vector-p X) (do ((i 0 (1+ i)) (k (maxindex x))) ((> i k) n) (if (NOT (SETQ N (SMALL-ENOUGH-COUNT (ELT X I) (1+ N) M))) @@ -1116,7 +1116,7 @@ EXAMINE (SETQ RECNO (NOTE |$InputStream|)) (MAKEPROP '|compFormWithModemap| '/TRANSFORM '(& * * & *)) (defun UNVEC (X) - (COND ((REFVECP X) (CONS '$ (VEC_TO_TREE X))) + (COND ((simple-vector-p X) (CONS '$ (VEC_TO_TREE X))) ((ATOM X) X) ((CONS (UNVEC (CAR X)) (UNVEC (CDR X)))))) diff --git a/src/interp/format.boot b/src/interp/format.boot index 2339954b..8843a680 100644 --- a/src/interp/format.boot +++ b/src/interp/format.boot @@ -180,7 +180,7 @@ reportOpSymbol op1 == null modemaps => ok := true sayKeyedMsg("S2IF0010",[op1]) - if SIZE PNAME op1 < 3 then + if # PNAME op1 < 3 then x := UPCASE queryUserKeyedMsg("S2IZ0060",[op1]) null (STRING2ID_-N(x,1) in '(Y YES)) => ok := nil @@ -621,7 +621,7 @@ formTuple2String argl == isInternalFunctionName(op) == (not IDENTP(op)) or (op = "*") or (op = "**") => NIL - (1 = SIZE(op':= PNAME op)) or (char("*") ~= op'.0) => NIL + (1 = #(op':= PNAME op)) or (char("*") ~= op'.0) => NIL -- if there is a semicolon in the name then it is the name of -- a compiled spad function null (e := STRPOS('"_;",op',1,NIL)) => NIL diff --git a/src/interp/functor.boot b/src/interp/functor.boot index 45cac30b..c8ab1c8a 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -226,9 +226,10 @@ compCategories1(u,v) == error 'compCategories1 NewbFVectorCopy(u,domName) == - v:= newShell SIZE u + v:= newShell # u for i in 0..5 repeat v.i:= u.i - for i in 6..MAXINDEX v | cons? u.i repeat v.i:= [function Undef,[domName,i],:first u.i] + for i in 6..MAXINDEX v | cons? u.i repeat + v.i:= [function Undef,[domName,i],:first u.i] v mkVector u == diff --git a/src/interp/g-cndata.boot b/src/interp/g-cndata.boot index 0aaa9f30..819fb583 100644 --- a/src/interp/g-cndata.boot +++ b/src/interp/g-cndata.boot @@ -130,7 +130,7 @@ constructorNameConflict(name,kind) == "%l",'"please choose another ",kind] constructorAbbreviationErrorCheck(c,a,typ,errmess) == - siz := SIZE (s := PNAME a) + siz := # (s := PNAME a) if typ = "category" and siz > 7 then throwKeyedErrorMsg('precompilation,"S2IL0021",NIL) if siz > 8 then throwKeyedErrorMsg('precompilation,"S2IL0006",NIL) diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 727c2073..5a2b32ab 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -703,7 +703,7 @@ ScanOrPairVec(f, ob) == ScanOrInner(f, first ob) ScanOrInner(f, rest ob) nil - VECP ob => + vector? ob => HPUT($seen, ob, true) for i in 0..#ob-1 repeat ScanOrInner(f, ob.i) nil @@ -1299,7 +1299,7 @@ intern x == x isDomain a == - cons? a and VECP(first a) and + cons? a and vector? first a and member(first a.0, $domainTypeTokens) -- variables used by browser diff --git a/src/interp/ggreater.lisp b/src/interp/ggreater.lisp index 81d7ca60..a6a570f6 100644 --- a/src/interp/ggreater.lisp +++ b/src/interp/ggreater.lisp @@ -1,6 +1,6 @@ ;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2010, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -50,11 +50,11 @@ ((consp COMPERAND-2) NIL) ((NULL COMPERAND-1) 'T ) ((NULL COMPERAND-2) NIL) - ((VECP COMPERAND-1) + ((simple-vector-p COMPERAND-1) (COND - ((VECP COMPERAND-2) (LEXVGREATERP COMPERAND-1 COMPERAND-2) ) + ((simple-vector-p COMPERAND-2) (LEXVGREATERP COMPERAND-1 COMPERAND-2) ) ('else t))) - ((VECP COMPERAND-2) NIL) + ((simple-vector-p COMPERAND-2) NIL) ((OR (IVECP COMPERAND-1) (RVECP COMPERAND-1)) (COND ( (OR (IVECP COMPERAND-2) (RVECP COMPERAND-2)) @@ -140,11 +140,11 @@ ((consp COMPERAND-2) NIL) ((NULL COMPERAND-1) 'T ) ((NULL COMPERAND-2) NIL) - ((VECP COMPERAND-1) + ((simple-vector-p COMPERAND-1) (COND - ((VECP COMPERAND-2) (VGREATERP COMPERAND-1 COMPERAND-2) ) + ((simple-vector-p COMPERAND-2) (VGREATERP COMPERAND-1 COMPERAND-2) ) ('else t))) - ((VECP COMPERAND-2) NIL) + ((simple-vector-p COMPERAND-2) NIL) ((OR (IVECP COMPERAND-1) (RVECP COMPERAND-1)) (COND ( (OR (IVECP COMPERAND-2) (RVECP COMPERAND-2)) diff --git a/src/interp/guess.boot b/src/interp/guess.boot index 096bacc1..2947b34c 100644 --- a/src/interp/guess.boot +++ b/src/interp/guess.boot @@ -170,7 +170,7 @@ findApproximateWords(word,table) == if i = 1 and null alist then --no winners, so try flattening to upper case and checking again - wordSize := SIZE word + wordSize := # word lastThreshold := MAX(threshold - 1,wordSize/2) for [x,:.] in wordAlist repeat k := deltaWordEntry(upperWord,UPCASE x) @@ -277,7 +277,7 @@ deltaWordEntry(word,entry) == word = entry => 0 word.0 ~= entry.0 => 1000 #word > 2 and stringPrefix?(word,entry) => 1 - ABS(diff := SIZE word - SIZE entry) > 4 => 1000 + ABS(diff := # word - # entry) > 4 => 1000 canForgeWord(word,entry) --+ Note these are optimized definitions below-- see commented out versions diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot index 1d37380c..c8ade7a3 100644 --- a/src/interp/i-coerfn.boot +++ b/src/interp/i-coerfn.boot @@ -571,7 +571,7 @@ L2Tuple(val, source is [.,S], target is [.,T]) == L2DP(l, source is [.,S], target is [.,n,T]) == -- need to know size of the list l = '_$fromCoerceable_$ => nil - n ~= SIZE l => coercionFailure() + n ~= # l => coercionFailure() (v := coerceInt(objNewWrap(LIST2VEC l,['Vector,S]),['Vector,T])) or coercionFailure() V2DP(objValUnwrap v, ['Vector, T], target) @@ -579,7 +579,7 @@ L2DP(l, source is [.,S], target is [.,n,T]) == V2DP(v, source is [.,S], target is [.,n,T]) == -- need to know size of the vector v = '_$fromCoerceable_$ => nil - n ~= SIZE v => coercionFailure() + n ~= # v => coercionFailure() (v1 := coerceInt(objNewWrap(v,source),['Vector,T])) or coercionFailure() dpFun := getFunctionFromDomain('directProduct, target, [['Vector,T]]) diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot index bbbb4524..cb0593f2 100644 --- a/src/interp/i-map.boot +++ b/src/interp/i-map.boot @@ -58,7 +58,7 @@ makeInternalMapName(userName,numArgs,numMms,extraPart) == isInternalMapName name == -- this only returns true or false as a "best guess" (not IDENTP(name)) or (name = "*") or (name = "**") => false - sz := SIZE (name' := PNAME name) + sz := # (name' := PNAME name) (sz < 7) or (char("*") ~= name'.0) => false not digit? name'.1 => false null STRPOS('"_;",name',1,NIL) => false diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot index bc847e3e..715e688b 100644 --- a/src/interp/i-output.boot +++ b/src/interp/i-output.boot @@ -552,11 +552,11 @@ outputTran x == op is ["$elt",targ,fun] or not $InteractiveMode and op is ["elt",targ,fun] => -- l has the args targ' := obj2String prefix2String targ - if 2 = SIZE targ then targ' := ['PAREN,targ'] + if 2 = # targ then targ' := ['PAREN,targ'] ['CONCAT,outputTran [fun,:l],'"$",targ'] x is ["$elt",targ,c] or not $InteractiveMode and x is ["elt",targ,c] => targ' := obj2String prefix2String targ - if 2 = SIZE targ then targ' := ['PAREN,targ'] + if 2 = # targ then targ' := ['PAREN,targ'] ['CONCAT,outputTran c,'"$",targ'] x is ["-",a,b] => a := outputTran a @@ -1102,12 +1102,12 @@ putWidth u == opWidth(op,has2Arguments) == op = "EQUATNUM" => 4 - integer? op => 2+SIZE STRINGIMAGE op + integer? op => 2 + # STRINGIMAGE op null has2Arguments => - a:= GETL(op,"PREFIXOP") => SIZE a - 2+SIZE PNAME op - a:= GETL(op,"INFIXOP") => SIZE a - 2+SIZE PNAME op + a:= GETL(op,"PREFIXOP") => # a + 2 + # PNAME op + a:= GETL(op,"INFIXOP") => # a + 2 + # PNAME op matrixBorder(x,y1,y2,d,leftOrRight) == y1 = y2 => @@ -1342,11 +1342,11 @@ bigopAppAux(bot,top,arg,x,y,d,kind) == xCenter := half(maxWidth-1) + x d:=APP(arg,x+2+maxWidth,y,d) d:= - atom bot and SIZE atom2String bot = 1 => APP(bot,xCenter,y-2,d) + atom bot and # atom2String bot = 1 => APP(bot,xCenter,y-2,d) APP(bot,x + half(maxWidth - botWidth),y-2-superspan bot,d) if top then d:= - atom top and SIZE atom2String top = 1 => APP(top,xCenter,y+2,d) + atom top and # atom2String top = 1 => APP(top,xCenter,y+2,d) APP(top,x + half(maxWidth - topWidth),y+2+subspan top,d) delta := (kind = 'pi => 2; 1) opCode := @@ -1599,7 +1599,7 @@ outputNumber(start,linelength,num) == firsttime:=(linelength>3) if linelength>2 then linelength:=linelength-1 - while SIZE(num) > linelength repeat + while # num > linelength repeat if $collectOutput then $outputLines := [strconc(blnks, SUBSTRING(num,0,linelength),under), :$outputLines] @@ -1619,7 +1619,7 @@ outputNumber(start,linelength,num) == outputString(start,linelength,str) == if start > 1 then blnks := fillerSpaces(start-1,'" ") else blnks := '"" - while SIZE(str) > linelength repeat + while # str > linelength repeat if $collectOutput then $outputLines := [strconc(blnks, SUBSTRING(str,0,linelength)), :$outputLines] diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot index 38ac6a62..5c9a2051 100644 --- a/src/interp/i-resolv.boot +++ b/src/interp/i-resolv.boot @@ -373,8 +373,8 @@ resolveTCat(t,c) == sd := superType t => resolveTCat(sd,c) - SIZE(td := deconstructT t) ~= 2=> NIL - SIZE(tc := deconstructT c) ~= 2 => NIL + #(td := deconstructT t) ~= 2=> NIL + #(tc := deconstructT c) ~= 2 => NIL ut := underDomainOf t null isValidType(uc := last tc) => NIL null canCoerceFrom(ut,uc) => NIL diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot index 22af7a91..1f6d4707 100644 --- a/src/interp/i-spec2.boot +++ b/src/interp/i-spec2.boot @@ -112,7 +112,7 @@ upDollar t == (not $genValue) and "or"/[CONTAINED(var,D) for var in $localVars] => keyedMsgCompFailure("S2IS0032",NIL) D="Lisp" => upLispCall(op,form) - if vector? D and (SIZE(D) > 0) then D := D.0 + if vector? D and (# D > 0) then D := D.0 t := evaluateType unabbrev D categoryForm? t => throwKeyedMsg("S2IE0012", [t]) diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot index 43375d0c..03f9a925 100644 --- a/src/interp/i-syscmd.boot +++ b/src/interp/i-syscmd.boot @@ -235,7 +235,7 @@ abbreviationsSpad2Cmd l == abbQuery(key) type is 'remove => DELDATABASE(key,'ABBREVIATION) - ODDP SIZE al => sayKeyedMsg("S2IZ0002",[type]) + ODDP # al => sayKeyedMsg("S2IZ0002",[type]) repeat null al => return 'fromLoop [a,b,:al] := al @@ -1680,7 +1680,7 @@ writeInputLines(fn,initial) == vecl := first readHiFi i if string? vecl then vecl := [vecl] for vec in vecl repeat - n := SIZE vec + n := # vec while n > maxn repeat -- search backwards for a blank done := nil @@ -1691,7 +1691,7 @@ writeInputLines(fn,initial) == lineList := [svec,:lineList] done := true vec := SUBSTRING(vec,k+1,NIL) - n := SIZE vec + n := # vec -- in case we can't find a breaking point if not done then n := 0 lineList := [vec,:lineList] @@ -3073,15 +3073,15 @@ processSynonyms() == null (fun := LASSOC (syn, $CommandSynonymAlist)) => NIL fun := eval fun -- fun may have been a suspension to := STRPOS('")",fun,1,NIL) - if to and to ~= SIZE(fun)-1 then + if to and to ~= #(fun)-1 then opt := strconc('" ",SUBSTRING(fun,to,NIL)) fun := SUBSTRING(fun,0,to-1) else opt := '" " - if (SIZE synstr) > (SIZE fun) then - for i in (SIZE fun)..(SIZE synstr) repeat + if # synstr > # fun then + for i in (# fun)..(# synstr) repeat fun := strconc (fun, '" ") --- $currentLine := strconc(fill,RPLACSTR(line, 1, SIZE synstr, fun),opt) - cl := strconc(fill,RPLACSTR(line, 1, SIZE synstr, fun),opt) +-- $currentLine := strconc(fill,RPLACSTR(line, 1, # synstr, fun),opt) + cl := strconc(fill,RPLACSTR(line, 1, # synstr, fun),opt) SETQ(LINE,cl) SETQ(CHR,LINE.(p+1)) processSynonyms () diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot index c55a3a5e..1d423706 100644 --- a/src/interp/i-util.boot +++ b/src/interp/i-util.boot @@ -51,12 +51,12 @@ inputPrompt str == y := $OLDLINE SETQ($OLDLINE,NIL) y => _$SHOWLINE(strconc(str,EBCDIC 19,y),p) - 0 = SIZE str => NIL + 0 = # str => NIL _$SHOWLINE(strconc(str,EBCDIC 19),p) protectedPrompt(:p) == [str,:br] := p - 0 = SIZE str => inputPrompt str + 0 = # str => inputPrompt str msg := EBCDIC 29 -- start of field msg := if br then strconc(msg,EBCDIC 232) -- bright write protect diff --git a/src/interp/interop.boot b/src/interp/interop.boot index d260b7cb..07deb159 100644 --- a/src/interp/interop.boot +++ b/src/interp/interop.boot @@ -463,7 +463,7 @@ hashNewLookupInTable(op,sig,dollar,[domain,opvec],flag) == hashNewLookupInCategories(op,sig,dom,dollar) == slot4 := dom.4 catVec := second slot4 - SIZE catVec = 0 => nil --early exit if no categories + # catVec = 0 => nil --early exit if no categories integer? KDR catVec.0 => newLookupInCategories1(op,sig,dom,dollar) --old style $lookupDefaults : local := nil @@ -497,7 +497,7 @@ hashNewLookupInCategories(op,sig,dom,dollar) == null code => nil byteVector := CDDDR infovec.3 endPos := - code+2 > max => SIZE byteVector + code+2 > max => # byteVector opvec.(code+2) --not nrunNumArgCheck(#sig.source,byteVector,opvec.code,endPos) => nil --numOfArgs := byteVector.(opvec.code) diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp index a99b3e4e..69bd3b2e 100644 --- a/src/interp/macros.lisp +++ b/src/interp/macros.lisp @@ -85,7 +85,7 @@ ((IDENTP V) NIL) ((STRINGP U) (AND (STRINGP V) (string> V U))) ((STRINGP V) NIL) - ((AND (VECP U) (VECP V)) + ((AND (simple-vector-p U) (simple-vector-p V)) (AND (> (SIZE V) (SIZE U)) (DO ((I 0 (1+ I))) ((GT I (MAXINDEX U)) 'T) diff --git a/src/interp/match.boot b/src/interp/match.boot index 775049c4..2411f599 100644 --- a/src/interp/match.boot +++ b/src/interp/match.boot @@ -44,20 +44,20 @@ maskMatch?(mask,subject) == substring?(part, whole, startpos) == --This function should be replaced by STRING< - np := SIZE part - nw := SIZE whole + np := # part + nw := # whole np > nw - startpos => false and/[CHAR_-EQUAL(part.ip, whole.iw) for ip in 0..np-1 for iw in startpos.. ] anySubstring?(part,whole,startpos) == - np := SIZE part - nw := SIZE whole + np := # part + nw := # whole or/[((k := i) and "and"/[CHAR_-EQUAL(part.ip,whole.iw) for ip in 0..np - 1 for iw in i..]) for i in startpos..nw - np] => k charPosition(c,t,startpos) == - n := SIZE t + n := # t startpos < 0 or startpos > n => n k:= startpos for i in startpos .. n-1 repeat @@ -71,9 +71,9 @@ rightCharPosition(c,t,startpos) == --startpos often equals MAXINDEX t (rightmost k stringPosition(s,t,startpos) == - n := SIZE t + n := # t if startpos < 0 or startpos > n then error '"index out of range" - if SIZE s = 0 then return startpos -- bug in STRPOS + if # s = 0 then return startpos -- bug in STRPOS r := STRPOS(s,t,startpos,NIL) if r = nil then n else r diff --git a/src/interp/msg.boot b/src/interp/msg.boot index e5e6c950..95407c1b 100644 --- a/src/interp/msg.boot +++ b/src/interp/msg.boot @@ -166,7 +166,7 @@ processChPosesForOneLine msgList == posLetter := rest assoc(poCharPosn getMsgPos msg,chPosList) oldPre := getMsgPrefix msg setMsgPrefix (msg,strconc(oldPre,_ - MAKE_-FULL_-CVEC ($preLength - 4 - SIZE oldPre),posLetter) ) + MAKE_-FULL_-CVEC ($preLength - 4 - # oldPre),posLetter) ) leaderMsg := makeLeaderMsg chPosList NCONC(msgList,[leaderMsg]) --a back cons @@ -426,7 +426,7 @@ listDecideHowMuch(pos,oldPos) == getPreStL optPre == null optPre => [MAKE_-FULL_-CVEC 2] spses := - (extraPlaces := ($preLength - (SIZE optPre) - 3)) > 0 => + (extraPlaces := ($preLength - (# optPre) - 3)) > 0 => MAKE_-FULL_-CVEC extraPlaces '"" ['"%b", optPre,spses,'":", '"%d"] @@ -518,7 +518,7 @@ makeMsgFromLine line == localNumOfLine := i := poLinePosn posOfLine stNum := STRINGIMAGE i - strconc(rep(char " ", ($preLength - 7 - SIZE stNum)),_ + strconc(rep(char " ", ($preLength - 7 - # stNum)),_ stNum) ['line,posOfLine,NIL,NIL, strconc('"Line", localNumOfLine),_ textOfLine] diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot index 7bc7cc3c..6d7ed990 100644 --- a/src/interp/msgdb.boot +++ b/src/interp/msgdb.boot @@ -267,7 +267,7 @@ $msgdbListPrims == '(%m %s %ce %rj "%m" "%s" "%ce" "%rj") noBlankBeforeP word== integer? word => false member(word,$msgdbNoBlanksBeforeGroup) => true - if string? word and SIZE word > 1 then + if string? word and # word > 1 then word.0 = char '% and word.1 = char 'x => return true word.0 = char " " => return true (cons? word) and member(first word,$msgdbListPrims) => true @@ -279,7 +279,7 @@ $msgdbNoBlanksAfterGroup == ['" ", " ",'"%" ,"%", :$msgdbPrims, noBlankAfterP word== integer? word => false member(word,$msgdbNoBlanksAfterGroup) => true - if string? word and (s := SIZE word) > 1 then + if string? word and (s := # word) > 1 then word.0 = char '% and word.1 = char 'x => return true word.(s-1) = char " " => return true (cons? word) and member(first word, $msgdbListPrims) => true @@ -807,7 +807,7 @@ sayBrightlyLength1 x == sayAsManyPerLineAsPossible l == -- it is assumed that l is a list of strings l := [atom2String a for a in l] - m := 1 + "MAX"/[SIZE(a) for a in l] + m := 1 + "MAX"/[# a for a in l] -- w will be the field width in which we will display the elements m > $LINELENGTH => for a in l repeat sayMSG a diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot index 203345e9..e5940afa 100644 --- a/src/interp/newfort.boot +++ b/src/interp/newfort.boot @@ -307,7 +307,7 @@ fortran2Lines1 f == line := normPref ff := first f while ok repeat - (ll + (sff := SIZE ff)) <= $fortLength => + (ll + (sff := # ff)) <= $fortLength => ll := ll + sff line := strconc(line,ff) f := rest f diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index 92ccc0f7..b922c7cd 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -455,7 +455,7 @@ buildFunctor($definition is [name,:args],sig,code,$locals,$e) == $template := newShell ($NRTbase + $NRTdeltaLength) $catvecList:= [domainShell,:[emptyVector for u in second domainShell.4]] $catNames := ['$] -- for DescendCode -- to be changed below for slot 4 - $SetFunctions:= newShell SIZE domainShell + $SetFunctions:= newShell # domainShell $catNames:= ['$,:[genvar() for u in rest catvecListMaker]] domname:='dv_$ diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot index e66cabdf..ea154adb 100644 --- a/src/interp/nrunfast.boot +++ b/src/interp/nrunfast.boot @@ -273,7 +273,7 @@ newLookupInDomain(op,sig,addFormDomain,dollar,index) == newLookupInCategories(op,sig,dom,dollar) == slot4 := dom.4 catVec := second slot4 - SIZE catVec = 0 => nil --early exit if no categories + # catVec = 0 => nil --early exit if no categories integer? KDR catVec.0 => newLookupInCategories1(op,sig,dom,dollar) --old style $lookupDefaults : local := nil @@ -307,7 +307,7 @@ newLookupInCategories(op,sig,dom,dollar) == null code => nil byteVector := CDDDR infovec.3 endPos := - code+2 > max => SIZE byteVector + code+2 > max => # byteVector opvec.(code+2) not nrunNumArgCheck(#sig.source,byteVector,opvec.code,endPos) => nil --numOfArgs := byteVector.(opvec.code) diff --git a/src/interp/nrunopt.boot b/src/interp/nrunopt.boot index 32adc79f..bd03608a 100644 --- a/src/interp/nrunopt.boot +++ b/src/interp/nrunopt.boot @@ -53,7 +53,7 @@ getInfovecCode() == makeDomainTemplate vec == --NOTES: This function is called at compile time to create the template -- (slot 0 of the infovec); called by getInfovecCode from compDefineFunctor1 - newVec := newShell SIZE vec + newVec := newShell # vec for index in 0..MAXINDEX vec repeat item := vec.index null item => nil @@ -634,7 +634,7 @@ dcData con == PRINT_-FULL $infovec.1 vec := getCodeVector() vec := (cons? vec => rest vec; vec) - sayBrightly ['"Information vector has ",SIZE vec,'" entries"] + sayBrightly ['"Information vector has ",# vec,'" entries"] dcData1 vec dcData1 vec == @@ -671,19 +671,19 @@ dcSize(:options) == lazyNodes := lazyNodes + numberOfNodes item tSize := sum(vectorSize(1 + maxindex),nodeSize(lazyNodes + latch)) -- functions are free in the template vector - oSize := vectorSize(SIZE infovec.1) + oSize := vectorSize(# infovec.1) aSize := numberOfNodes infovec.2 slot4 := infovec.3 catvec := vector? CDDR slot4 => second slot4 third slot4 n := MAXINDEX catvec - cSize := sum(nodeSize(2),vectorSize(SIZE first slot4),vectorSize(n + 1), + cSize := sum(nodeSize(2),vectorSize(# first slot4),vectorSize(n + 1), nodeSize(+/[numberOfNodes catvec.i for i in 0..n])) codeVector := vector? CDDR slot4 => CDDR slot4 CDDDR slot4 - vSize := halfWordSize(SIZE codeVector) + vSize := halfWordSize(# codeVector) itotal := sum(tSize,oSize,aSize,cSize,vSize) if null quiet then sayBrightly ['"infovec total = ",itotal,'" BYTES"] if null quiet then diff --git a/src/interp/pathname.boot b/src/interp/pathname.boot index 5a526fad..5887354a 100644 --- a/src/interp/pathname.boot +++ b/src/interp/pathname.boot @@ -115,7 +115,7 @@ newMKINFILENAM(infile) == if fn = '"*" or fn = '"NIL" then sayKeyedMsg("S2IL0016",NIL) else sayKeyedMsg("S2IL0003",[namestring file]) ans := queryUserKeyedMsg("S2IL0017",NIL) - if (SIZE(ans) > 0) and ('")" = SUBSTRING(ans,0,1)) then n := 2 + if (#(ans) > 0) and ('")" = SUBSTRING(ans,0,1)) then n := 2 else n := 1 nfn := UPCASE STRING2ID_-N(ans,n) (nfn = 0) or (nfn = 'QUIT) => diff --git a/src/interp/pspad2.boot b/src/interp/pspad2.boot index 3cea4138..92434706 100644 --- a/src/interp/pspad2.boot +++ b/src/interp/pspad2.boot @@ -556,7 +556,7 @@ nary2Binary(u,op) == errhuh() string2PrintImage s == - u:= GETSTR (2*SIZE s) + u:= GETSTR (2*# s) for i in 0..MAXINDEX s repeat (if s.i in '(_( _{ _) _} _! _") then SUFFIX('__,u); u:= SUFFIX(s.i,u)) @@ -565,7 +565,7 @@ string2PrintImage s == ident2PrintImage s == m := MAXINDEX s if m > 1 and s.(m - 1) = $underScore then s := strconc(SUBSTRING(s,0,m-1),s.m) - u:= GETSTR (2*SIZE s) + u:= GETSTR (2*# s) if not (alphabetic? s.(0) or s.(0)=char '"$") then SUFFIX('__,u) u:= SUFFIX(s.(0),u) for i in 1..MAXINDEX s repeat diff --git a/src/interp/trace.boot b/src/interp/trace.boot index 67ffca86..3ccfa57a 100644 --- a/src/interp/trace.boot +++ b/src/interp/trace.boot @@ -127,7 +127,7 @@ trace1 l == newOptions:= delete(a,$options) null l => trace1 oldL for x in l repeat - x is [domain,:opList] and VECP domain => + x is [domain,:opList] and vector? domain => sayKeyedMsg("S2IT0003",[devaluate domain]) $options:= [:newOptions,:LASSOC(x,$optionAlist)] trace1 LIST x diff --git a/src/interp/union.lisp b/src/interp/union.lisp index 6698e36d..311ffff0 100644 --- a/src/interp/union.lisp +++ b/src/interp/union.lisp @@ -1,6 +1,6 @@ ;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2010, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -67,10 +67,10 @@ LP (COND ( (NOT (PAIRP LIST-OF-ITEMS-1)) (RETURN (QCDR H)) ) - ( (QMEMQ + ( (MEMQ (SETQ I (QCAR (RESETQ LIST-OF-ITEMS-1 (QCDR LIST-OF-ITEMS-1)))) (QCDR H)) ) - ( (QMEMQ I LIST-OF-ITEMS-2) + ( (MEMQ I LIST-OF-ITEMS-2) (QRPLACD V (SETQ V (CONS I NIL))) ) ) (GO LP) ) ) @@ -114,7 +114,7 @@ ( 'T (RETURN (QCDR H)) ) ) ) ( (NOT - (QMEMQ + (MEMQ (SETQ I (QCAR (RESETQ LIST-OF-ITEMS-1 (QCDR LIST-OF-ITEMS-1)))) (QCDR H))) (QRPLACD V (SETQ V (CONS I NIL))) ) ) @@ -151,9 +151,9 @@ LP1 (COND ( (NOT (PAIRP LIST-OF-ITEMS-1)) (RETURN (QCDR H)) ) - ( (QMEMQ + ( (MEMQ (SETQ I (QCAR (RESETQ LIST-OF-ITEMS-1 (QCDR LIST-OF-ITEMS-1)))) (QCDR H)) ) - ( (NOT (QMEMQ I LIST-OF-ITEMS-2)) + ( (NOT (MEMQ I LIST-OF-ITEMS-2)) (QRPLACD V (SETQ V (CONS I NIL))) ) ) (GO LP1) ) ) diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp index e388367e..3729558f 100644 --- a/src/interp/vmlisp.lisp +++ b/src/interp/vmlisp.lisp @@ -93,9 +93,6 @@ (defmacro |copyList| (x) `(copy-list ,x)) -(defmacro cvecp (x) - `(stringp ,x)) - (defmacro dcq (&rest args) (cons 'setqp args)) @@ -330,10 +327,6 @@ (defmacro qlength (a) `(length ,a)) -; (defmacro qmemq (a b) -; `(member ,a ,b :test #'eq)) -(defmacro qmemq (a b) `(memq ,a ,b)) - (defmacro qrefelt (vec ind) `(svref ,vec ,ind)) @@ -423,8 +416,6 @@ (defmacro qvsize (x) `(the fixnum (length (the simple-vector ,x)))) -(defmacro refvecp (v) `(simple-vector-p ,v)) - (defmacro resetq (a b) `(prog1 ,a (setq ,a ,b))) @@ -476,8 +467,6 @@ (defmacro vec-setelt (vec ind val) `(setf (svref ,vec ,ind) ,val)) -(defmacro vecp (v) `(simple-vector-p ,v)) - (defmacro zero? (x) `(and (typep ,x 'fixnum) (zerop (the fixnum ,x)))) @@ -1514,7 +1503,7 @@ (COND ( (VARP BV-LIST) (LIST BV-LIST) ) - ( (REFVECP BV-LIST) + ( (simple-vector-p BV-LIST) (FLAT-BV-LIST (VEC2LIST (MAPELT #'FLAT-BV-LIST BV-LIST))) ) ( (NOT (consp BV-LIST)) NIL ) @@ -1522,7 +1511,7 @@ (FLAT-BV-LIST (QCDR BV-LIST)) ) ( (VARP TMP1) (CONS TMP1 (FLAT-BV-LIST (QCDR BV-LIST))) ) - ( (AND (NOT (consp TMP1)) (NOT (REFVECP TMP1))) + ( (AND (NOT (consp TMP1)) (NOT (simple-vector-p TMP1))) (FLAT-BV-LIST (QCDR BV-LIST)) ) ( 'T (NCONC (FLAT-BV-LIST TMP1) (FLAT-BV-LIST (QCDR BV-LIST))) ) )) )) diff --git a/src/interp/word.boot b/src/interp/word.boot index 13c8b590..eb7e9c3d 100644 --- a/src/interp/word.boot +++ b/src/interp/word.boot @@ -98,7 +98,7 @@ getListOfFunctionNames(fnames) == null IOSTATE(fn,'DIRECT,'_*) => 'iterate stream:= DEFIOSTREAM(['(MODE . INPUT),['FILE,fn,'DIRECT,'_*]],80,0) while (not PLACEP (x:= readLine stream)) repeat - (s := SIZE x) < 26 => 'iterate + (s := # x) < 26 => 'iterate res:= [SUBSTRING(x,26,NIL),:res] SHUT stream res @@ -268,7 +268,7 @@ findApproximateWords(word,table) == --no winners, so try flattening to upper case and checking again - wordSize := SIZE word + wordSize := # word lastThreshold := MAX(3,wordSize/2) vec := GETREFV lastThreshold for [x,:.] in alist repeat @@ -277,7 +277,7 @@ findApproximateWords(word,table) == or/[vec.k for k in 0..MAXINDEX vec] guessFromList(key,stringList) == - threshold := MAX(3,(SIZE key)/2) + threshold := MAX(3,(# key)/2) vec := GETREFV threshold for x in stringList repeat k := deltaWordEntry(key,x) @@ -286,7 +286,7 @@ guessFromList(key,stringList) == deltaWordEntry(word,entry) == word = entry => 0 - ABS(diff := SIZE word - SIZE entry) > 4 => 1000 + ABS(diff := # word - # entry) > 4 => 1000 canForgeWord(word,entry) --+ Note these are optimized definitions below-- see commented out versions |