diff options
author | dos-reis <gdr@axiomatics.org> | 2010-12-29 17:51:01 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-12-29 17:51:01 +0000 |
commit | 25671a46921cd1e72d296ed5cbcdc72de78f569d (patch) | |
tree | 64b93ee7e988e1faf37bf34e6322da80d14c31ff /src/interp/g-util.boot | |
parent | d6e1db9b19a58fd6298e3d37eb6ec25f34ff191a (diff) | |
download | open-axiom-25671a46921cd1e72d296ed5cbcdc72de78f569d.tar.gz |
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include %strlength.
* interp/g-util.boot: Expand it.
* algebra/string.spad.pamphlet (String): Remove use of QCSIZE.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r-- | src/interp/g-util.boot | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 9737c712..3a2504cf 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -512,6 +512,7 @@ for x in [ -- string unary functions ['%string?, :'STRINGP], + ['%strlength, :'LENGTH], -- general utility ['%hash, :'SXHASH], @@ -600,7 +601,7 @@ isSharpVar x == isSharpVarWithNum x == not isSharpVar x => nil - (n := QCSIZE(p := PNAME x)) < 2 => nil + (n := #(p := PNAME x)) < 2 => nil ok := true c := 0 for i in 1..(n-1) while ok repeat @@ -977,8 +978,8 @@ stringPrefix?(pref,str) == -- sees if the first #pref letters of str are pref -- replaces STRINGPREFIXP not (string?(pref) and string?(str)) => NIL - (lp := QCSIZE pref) = 0 => true - lp > QCSIZE str => NIL + (lp := # pref) = 0 => true + lp > # str => NIL ok := true i := 0 while ok and (i < lp) repeat @@ -992,13 +993,13 @@ stringChar2Integer(str,pos) == -- in string str. Returns NIL if not a digit or other error. if IDENTP str then str := PNAME str not (string?(str) and - integer?(pos) and (pos >= 0) and (pos < QCSIZE(str))) => NIL + integer?(pos) and (pos >= 0) and (pos < #str)) => NIL not digit?(d := SCHAR(str,pos)) => NIL DIG2FIX d dropLeadingBlanks str == str := object2String str - l := QCSIZE str + l := # str nb := NIL i := 0 while (i < l) and not nb repeat |