There is no need to use Reference for Domain local variables,
they can be used directly in functions. So remove the usage
of Reference for consistency and less verbosity.
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/CAGBJN92i6o3jCsmskSQdDEd3pT-ceXBv0BNTQeJ1%2BUmtKqrf4g%40mail.gmail.com.
diff --git a/src/algebra/algext.spad b/src/algebra/algext.spad
index e6bbe188..7dee485a 100644
--- a/src/algebra/algext.spad
+++ b/src/algebra/algext.spad
@@ -35,9 +35,9 @@ SimpleAlgebraicExtension(R : CommutativeRing,
d := degree M
d1 := subtractIfCan(d, 1)::NonNegativeInteger
discmat : Matrix(R) := zero(d, d)
- nodiscmat? : Reference(Boolean) := ref true
- disc : Reference(R) := ref 0
- nodisc? : Reference(Boolean) := ref true
+ nodiscmat? : Boolean := true
+ disc : R := 0
+ nodisc? : Boolean := true
bsis := [monomial(1, i)$Rep for i in 0..d1]$Vector(Rep)
if R has Finite then
@@ -104,20 +104,20 @@ SimpleAlgebraicExtension(R : CommutativeRing,
map(lift, v)$VectorFunctions2(%, UP))
discriminant() ==
- if nodisc?() then mkDisc false
- disc()
+ if nodisc? then mkDisc false
+ disc
mkDisc b ==
- nodisc?() := b
- disc() := discriminant M
+ nodisc? := b
+ disc := discriminant M
void
traceMatrix() ==
- if nodiscmat?() then mkDiscMat false
+ if nodiscmat? then mkDiscMat false
discmat
mkDiscMat b ==
- nodiscmat?() := b
+ nodiscmat? := b
mr := minRowIndex discmat; mc := minColIndex discmat
for i in 0..d1 repeat
for j in 0..d1 repeat
diff --git a/src/algebra/any.spad b/src/algebra/any.spad
index 8a5b00d6..69730ef6 100644
--- a/src/algebra/any.spad
+++ b/src/algebra/any.spad
@@ -85,7 +85,7 @@ Any() : SetCategory with
== add
Rep := Record(dm : SExpression, ob : None)
- printTypeInOutputP : Reference(Boolean) := ref false
+ printTypeInOutputP : Boolean := false
obj x == x.ob
dom x == x.dm
@@ -107,13 +107,13 @@ Any() : SetCategory with
list('OutputForm)$List(Symbol))$Lisp
showTypeInOutput(b : Boolean) : String ==
- printTypeInOutputP := ref b
+ printTypeInOutputP := b
b=> "Type of object will be displayed in output of a member of Any"
"Type of object will not be displayed in output of a member of Any"
coerce(x) : OutputForm ==
obj1 : OutputForm := objectOf x
- not deref printTypeInOutputP => obj1
+ not printTypeInOutputP => obj1
dom1 :=
p : SExpression := prefix2String(devaluate(x.dm)$Lisp)$Lisp
atom?(p) => list(p pretend OutputForm)$List(OutputForm)
diff --git a/src/algebra/card.spad b/src/algebra/card.spad
index 112a6c02..cf4b7399 100644
--- a/src/algebra/card.spad
+++ b/src/algebra/card.spad
@@ -76,7 +76,7 @@ CardinalNumber : Join(OrderedSet, AbelianMonoid, Monoid,
Rep := Record(order : Integer, ival : Integer)
import from Integer
- GCHypothesis : Reference(Boolean) := ref false
+ GCHypothesis : Boolean := false
-- Creation
0 == [FINord, 0]
@@ -124,7 +124,7 @@ CardinalNumber : Join(OrderedSet, AbelianMonoid, Monoid,
[FINord, x.ival^(y.ival)::NNI]
x = 0 => 0
x = 1 => 1
- GCHypothesis() => [max(x.order-1, y.order) + 1, DUMMYval]
+ GCHypothesis => [max(x.order-1, y.order) + 1, DUMMYval]
error "Transfinite exponentiation only implemented under GCH"
finite? x == x.order = FINord
@@ -139,8 +139,8 @@ CardinalNumber : Join(OrderedSet, AbelianMonoid, Monoid,
"failed"
-- State manipulation
- generalizedContinuumHypothesisAssumed?() == GCHypothesis()
- generalizedContinuumHypothesisAssumed b == (GCHypothesis() := b)
+ generalizedContinuumHypothesisAssumed?() == GCHypothesis
+ generalizedContinuumHypothesisAssumed b == GCHypothesis := b
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
diff --git a/src/algebra/curve.spad b/src/algebra/curve.spad
index 8a5762f1..c200b0e0 100644
--- a/src/algebra/curve.spad
+++ b/src/algebra/curve.spad
@@ -575,7 +575,7 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n) : Exports == Impl where
UP2 ==> SparseUnivariatePolynomial UP
REC ==> Record(factor : UP, exponent : N)
MOD ==> monomial(1, n)$UPUP - radicnd::UPUP
- INIT ==> if (deref brandNew?) then startUp false
+ INIT ==> if brandNew? then startUp false
Exports ==> FunctionFieldCategory(F, UP, UPUP)
@@ -597,9 +597,9 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n) : Exports == Impl where
radcand : () -> UP
charPintbas : (UPUP, RF, Vector RF, Vector RF) -> Void
- brandNew? : Reference(Boolean) := ref true
- discPoly : Reference(RF) := ref(0$RF)
- newrad : Reference(UP) := ref(0$UP)
+ brandNew? : Boolean := true
+ discPoly : RF := 0$RF
+ newrad : UP := 0$UP
n1 := (n - 1)::N
modulus := MOD
ibasis : Vector(RF) := new(n, 0)
@@ -608,8 +608,8 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n) : Exports == Impl where
invinfbasis : Vector(RF) := new(n, 0)
mini := minIndex ibasis
- discriminant() == (INIT; discPoly())
- radcand() == (INIT; newrad())
+ discriminant() == (INIT; discPoly)
+ radcand() == (INIT; newrad)
integralBasis() == (INIT; diag ibasis)
integralBasisAtInfinity() == (INIT; diag infbasis)
basisvec() == (INIT; ibasis)
@@ -702,20 +702,20 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n) : Exports == Impl where
charPintbas(r.poly, (r.coef) x, infbasis, invinfbasis)
startUp b ==
- brandNew?() := b
+ brandNew? := b
if zero?(p := characteristic()$F) or p > n then char0StartUp()
else charPStartUp()
dsc : RF := ((-1)$Z ^ ((n *$N n1) quo 2::N) * (n::Z)^n)$Z *
radicnd ^ n1 *
*/[qelt(ibasis, i) ^ 2 for i in mini..maxIndex ibasis]
- discPoly() := primitivePart(numer dsc) / denom(dsc)
+ discPoly := primitivePart(numer dsc) / denom(dsc)
void
char0StartUp() ==
rp := rootPoly(radicnd, n)
rp.exponent ~= n => error "RadicalFunctionField: curve is not irreducible"
- newrad() := rp.radicand
- ib := iBasis(newrad(), n)
+ newrad := rp.radicand
+ ib := iBasis(newrad, n)
infb := inftyBasis(radicnd, n)
invden : RF := 1
for i in mini..maxIndex ib repeat
@@ -769,7 +769,7 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
QF ==> Fraction UPUP
UP2 ==> SparseUnivariatePolynomial UP
SAE ==> SimpleAlgebraicExtension(RF, UPUP, modulus)
- INIT ==> if (deref brandNew?) then startUp false
+ INIT ==> if brandNew? then startUp false
Exports ==> FunctionFieldCategory(F, UP, UPUP) with
knownInfBasis : N -> Void
@@ -785,9 +785,9 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
vect : Matrix RF -> Vector %
getInfBasis : () -> Void
- brandNew? : Reference(Boolean) := ref true
- infBr? : Reference(Boolean) := ref true
- discPoly : Reference(RF) := ref 0
+ brandNew? : Boolean := true
+ infBr? : Boolean := true
+ discPoly : RF := 0
n := degree modulus
n1 := (n - 1)::N
ibasis : Matrix(RF) := zero(n, n)
@@ -795,8 +795,8 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
infbasis : Matrix(RF) := copy ibasis
invinfbasis : Matrix(RF) := copy ibasis
- branchPointAtInfinity?() == (INIT; infBr?())
- discriminant() == (INIT; discPoly())
+ branchPointAtInfinity?() == (INIT; infBr?)
+ discriminant() == (INIT; discPoly)
integralBasis() == (INIT; vect ibasis)
integralBasisAtInfinity() == (INIT; vect infbasis)
integralMatrix() == (INIT; ibasis)
@@ -813,7 +813,7 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
splitDenominator(coordinates(f) * inverseIntegralMatrix())
knownInfBasis d ==
- if deref brandNew? then
+ if brandNew? then
alpha := [monomial(1, d * i)$UP :: RF for i in 0..n1]$Vector(RF)
ib := diagonalMatrix
[inv qelt(alpha, i) for i in minIndex alpha .. maxIndex alpha]
@@ -848,7 +848,7 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
void
startUp b ==
- brandNew?() := b
+ brandNew? := b
nmod : UP2 := map(retract, modulus)
ib := integralBasis()$FunctionFieldIntegralBasis(UP, UP2,
SimpleAlgebraicExtension(UP, UP2, nmod))
@@ -867,9 +867,9 @@ AlgebraicFunctionField(F, UP, UPUP, modulus) : Exports == Impl where
dsc := resultant(modulus, differentiate modulus)
dsc0 := dsc * determinant(infbasis) ^ 2
degree(numer dsc0) > degree(denom dsc0) =>error "Shouldn't happen"
- infBr?() := degree(numer dsc0) < degree(denom dsc0)
+ infBr? := degree(numer dsc0) < degree(denom dsc0)
dsc := dsc * determinant(ibasis) ^ 2
- discPoly() := primitivePart(numer dsc) / denom(dsc)
+ discPoly := primitivePart(numer dsc) / denom(dsc)
void
integralDerivationMatrix d ==
diff --git a/src/algebra/divisor.spad b/src/algebra/divisor.spad
index a67de4e8..ba7f047a 100644
--- a/src/algebra/divisor.spad
+++ b/src/algebra/divisor.spad
@@ -496,8 +496,8 @@ FractionalIdealAsModule(R, F, UP, A, ibasis) : Exports == Implementation where
Rep := VA
- iflag? : Reference(Boolean) := ref true
- wflag? : Reference(Boolean) := ref true
+ iflag? : Boolean := true
+ wflag? : Boolean := true
imat := new(#ibasis, #ibasis, 0)$M
wmat := new(#ibasis, #ibasis, 0)$M
@@ -533,11 +533,11 @@ FractionalIdealAsModule(R, F, UP, A, ibasis) : Exports == Implementation where
false
invintmat() ==
- if iflag?() then iflag?() := getinvintmat()
+ if iflag? then iflag? := getinvintmat()
imat
intmat() ==
- if wflag?() then wflag?() := getintmat()
+ if wflag? then wflag? := getintmat()
wmat
vectProd(v1, v2) ==
diff --git a/src/algebra/float.spad b/src/algebra/float.spad
index 894d9b0f..f7d1a531 100644
--- a/src/algebra/float.spad
+++ b/src/algebra/float.spad
@@ -133,7 +133,7 @@ Float():
++ outputSpacing(0) means no spaces are inserted.
== add
BASE ==> 2
- BITS : Reference(PI) := ref 68 -- 20 digits
+ BITS : PI := 68 -- 20 digits
LENGTH(n) ==> qcoerce(length(n)$I)@N
ISQRT ==> approxSqrt$IntegerRoots(I)
Rep := Record( mantissa : I, exponent : I )
@@ -539,8 +539,8 @@ Float():
i := ISQRT i
normalize [i, (e-p) quo 2]
- bits() == BITS()
- bits(n) == (t := bits(); BITS() := n; t)
+ bits() == BITS
+ bits(n) == (t := BITS; BITS := n; t)
precision() == bits()
precision(n) == bits(n)
increasePrecision n == (b := bits(); bits((b + n)::PI); b)
@@ -794,35 +794,35 @@ Float():
zero ==> char("0")
separator ==> escape()$Character
- SPACING : Reference(N) := ref 10
- OUTMODE : Reference(S) := ref "general"
- OUTPREC : Reference(I) := ref(-1)
+ SPACING : N := 10
+ OUTMODE : S := "general"
+ OUTPREC : I := -1
fixed : % -> S
floating : % -> S
general : % -> S
padFromLeft(s : S) : S ==
- zero? SPACING() => s
+ zero? SPACING => s
n : I := #s - 1
- t := new( (n + 1 + n quo SPACING()) :: N , separator )
+ t := new( (n + 1 + n quo SPACING) :: N , separator )
for i in 0..n for j in minIndex t .. repeat
t.j := s.(i + minIndex s)
- if (i+1) rem SPACING() = 0 then j := j+1
+ if (i+1) rem SPACING = 0 then j := j+1
t
padFromRight(s : S) : S ==
- SPACING() = 0 => s
+ SPACING = 0 => s
n : I := #s - 1
- t := new( (n + 1 + n quo SPACING()) :: N , separator )
+ t := new( (n + 1 + n quo SPACING) :: N , separator )
for i in n..0 by -1 for j in maxIndex t .. by -1 repeat
t.j := s.(i + minIndex s)
- if (n-i+1) rem SPACING() = 0 then j := j-1
+ if (n-i+1) rem SPACING = 0 then j := j-1
t
fixed f ==
- d := if OUTPREC() = -1 then digits::I else OUTPREC()
+ d := if OUTPREC = -1 then digits::I else OUTPREC
zero? f =>
- OUTPREC() = -1 => "0.0"
+ OUTPREC = -1 => "0.0"
concat("0", concat(".", padFromLeft new(d::N, zero)))
zero? exponent f =>
concat(padFromRight convert(mantissa f)@S,
@@ -830,19 +830,19 @@ Float():
negative? f => concat("-", fixed abs f)
bl := LENGTH(f.mantissa) + f.exponent
dd :=
- OUTPREC() = -1 => d
+ OUTPREC = -1 => d
bl > 0 => (146*bl) quo 485 + 1 + d
d
g := convert10(abs f, dd)
m := g.mantissa; e := g.exponent
- if OUTPREC() ~= -1 then
+ if OUTPREC ~= -1 then
-- round g to OUTPREC digits after the decimal point
l := length10 m
- if -e > OUTPREC() and -e < 2*digits::I then
- g := normalize10(g, l+e+OUTPREC())
+ if -e > OUTPREC and -e < 2*digits::I then
+ g := normalize10(g, l+e+OUTPREC)
m := g.mantissa; e := g.exponent
s := convert(m)@S; n := #s; o := e+n
- p := if OUTPREC() = -1 then n::I else OUTPREC()
+ p := if OUTPREC = -1 then n::I else OUTPREC
t : S
if e >= 0 then
s := concat(s, new(e::N, zero))
@@ -854,7 +854,7 @@ Float():
t := s(o + minIndex s .. n + minIndex s - 1)
s := s(minIndex s .. o + minIndex s - 1)
n := #t
- if OUTPREC() = -1 then
+ if OUTPREC = -1 then
t := rightTrim(t, zero)
if t = "" then t := "0"
else if n > p then t := t(minIndex t .. p + minIndex t- 1)
@@ -864,12 +864,12 @@ Float():
floating f ==
zero? f => "0.0"
negative? f => concat("-", floating abs f)
- t:S := if zero? SPACING() then "E" else " E "
+ t:S := if zero? SPACING then "E" else " E "
zero? exponent f =>
s := convert(mantissa f)@S
concat ["0.", padFromLeft s, t, convert(#s)@S]
-- base conversion to decimal rounded to the requested precision
- d := if OUTPREC() = -1 then digits::I else OUTPREC()
+ d := if OUTPREC = -1 then digits::I else OUTPREC
g := convert10(f, d); m := g.mantissa; e := g.exponent
-- I'm assuming that length10 m = # s given n > 0
s := convert(m)@S; n := #s; o := e+n
@@ -879,12 +879,12 @@ Float():
general(f) ==
zero? f => "0.0"
negative? f => concat("-", general abs f)
- d := if OUTPREC() = -1 then digits::I else OUTPREC()
+ d := if OUTPREC = -1 then digits::I else OUTPREC
zero? exponent f =>
d := d + 1
s := convert(mantissa f)@S
- OUTPREC() ~= -1 and (e := #s) > d =>
- t:S := if zero? SPACING() then "E" else " E "
+ OUTPREC ~= -1 and (e := #s) > d =>
+ t:S := if zero? SPACING then "E" else " E "
concat ["0.", padFromLeft s, t, convert(e)@S]
padFromRight concat(s, ".0")
-- base conversion to decimal rounded to the requested precision
@@ -906,26 +906,26 @@ Float():
else
-- print using E format written 0.mantissa E exponent
t := padFromLeft rightTrim(s, zero)
- s := if zero? SPACING() then "E" else " E "
+ s := if zero? SPACING then "E" else " E "
concat ["0.", t, s, convert(e+n)@S]
- outputSpacing n == SPACING() := n
- outputFixed() == (OUTMODE() := "fixed"; OUTPREC() := -1)
- outputFixed n == (OUTMODE() := "fixed"; OUTPREC() := n::I)
- outputGeneral() == (OUTMODE() := "general"; OUTPREC() := -1)
- outputGeneral n == (OUTMODE() := "general"; OUTPREC() := n::I)
- outputFloating() == (OUTMODE() := "floating"; OUTPREC() := -1)
- outputFloating n == (OUTMODE() := "floating"; OUTPREC() := n::I)
+ outputSpacing n == SPACING := n
+ outputFixed() == (OUTMODE := "fixed"; OUTPREC := -1)
+ outputFixed n == (OUTMODE := "fixed"; OUTPREC := n::I)
+ outputGeneral() == (OUTMODE := "general"; OUTPREC := -1)
+ outputGeneral n == (OUTMODE := "general"; OUTPREC := n::I)
+ outputFloating() == (OUTMODE := "floating"; OUTPREC := -1)
+ outputFloating n == (OUTMODE := "floating"; OUTPREC := n::I)
convert(f) : S ==
b : Integer :=
- OUTPREC() = -1 and not zero? f =>
+ OUTPREC = -1 and not zero? f =>
bits(length(abs mantissa f)::PositiveInteger)
0
s :=
- OUTMODE() = "fixed" => fixed f
- OUTMODE() = "floating" => floating f
- OUTMODE() = "general" => general f
+ OUTMODE = "fixed" => fixed f
+ OUTMODE = "floating" => floating f
+ OUTMODE = "general" => general f
empty()$String
if b > 0 then bits(b::PositiveInteger)
s = empty()$String => error "bad output mode"
diff --git a/src/algebra/lodof.spad b/src/algebra/lodof.spad
index 608de317..afbca645 100644
--- a/src/algebra/lodof.spad
+++ b/src/algebra/lodof.spad
@@ -39,8 +39,8 @@ SetOfMIntegersInOneToN(m, n) : Exports == Implementation where
reallyEnumerate : () -> Vector %
enum : (N, N, PI) -> List Bits
- all : Reference Vector % := ref empty()
- sz : Reference N := ref 0
+ all : Vector % := empty()
+ sz : N := 0
s1 = s2 == s1.bits =$Bits s2.bits
coerce(s : %) : OutputForm == brace [i::OutputForm for i in elements s]
@@ -48,8 +48,8 @@ SetOfMIntegersInOneToN(m, n) : Exports == Implementation where
member?(p, s) == s.bits.p
enumerate() : Vector(%) ==
- if empty? all() then all() := reallyEnumerate()
- all()
+ if empty? all then all := reallyEnumerate()
+ all
-- enumerates the sets of p integers in 1..q, returns them as sets in 1..n
-- must have p <= q
@@ -66,19 +66,19 @@ SetOfMIntegersInOneToN(m, n) : Exports == Implementation where
concat!(enum(p, q1, n), l)
size() ==
- if zero? sz() then
- sz() := binomial(n, m)$IntegerCombinatoricFunctions(Integer) :: N
- sz()
+ if zero? sz then
+ sz := binomial(n, m)$IntegerCombinatoricFunctions(Integer) :: N
+ sz
lookup s ==
- if empty? all() then all() := reallyEnumerate()
- if zero?(s.pos) then s.pos := position(s, all()) :: N
+ if empty? all then all := reallyEnumerate()
+ if zero?(s.pos) then s.pos := position(s, all) :: N
s.pos :: PI
index p ==
p > size() => error "index: argument too large"
- if empty? all() then all() := reallyEnumerate()
- all().p
+ if empty? all then all := reallyEnumerate()
+ all.p
setOfMinN l ==
s := new(n, false)$Bits
diff --git a/src/algebra/op.spad b/src/algebra/op.spad
index 580fb912..1d50e0b1 100644
--- a/src/algebra/op.spad
+++ b/src/algebra/op.spad
@@ -329,7 +329,7 @@ CommonOperators() : Exports == Implementation where
startUp : Boolean -> Void
setDummyVar : (OP, NonNegativeInteger) -> OP
- brandNew? : Reference(Boolean) := ref true
+ brandNew? : Boolean := true
opalg := operator('rootOf, 2)$OP
oproot := operator('nthRoot, 2)
@@ -543,7 +543,7 @@ CommonOperators() : Exports == Implementation where
dummyvarop2 := [opdint, opdsum, opdprod]
operator s ==
- if (deref brandNew?) then startUp false
+ if brandNew? then startUp false
for op in allop repeat
is?(op, s) => return copy op
operator(s)$OP
@@ -572,7 +572,7 @@ CommonOperators() : Exports == Implementation where
convert([convert('product)$InputForm, a.1, eq])
startUp b ==
- brandNew?() := b
+ brandNew? := b
display(oppren, paren)
display(opbox, commaSeparate)
display(oppi, dpi)
diff --git a/src/algebra/setorder.spad b/src/algebra/setorder.spad
index 96931172..dd564fa9 100644
--- a/src/algebra/setorder.spad
+++ b/src/algebra/setorder.spad
@@ -44,16 +44,16 @@ UserDefinedPartialOrdering(S : SetCategory) : with
++ comparable in the partial ordering.
== add
- llow : Reference List S := ref([])
- lhigh : Reference List S := ref([])
+ llow : List S := []
+ lhigh : List S := []
- userOrdered?() == not(empty? deref llow) or not(empty? deref lhigh)
- getOrder() == [deref llow, deref lhigh]
+ userOrdered?() == not empty? llow or not empty? lhigh
+ getOrder() == [llow, lhigh]
setOrder l == setOrder([], l)
setOrder(l, h) ==
- setref(llow, removeDuplicates l)
- setref(lhigh, removeDuplicates h)
+ llow := removeDuplicates l
+ lhigh := removeDuplicates h
void
less?(a, b, f) ==
@@ -68,11 +68,11 @@ UserDefinedPartialOrdering(S : SetCategory) : with
first x
less?(a, b) ==
- for x in deref llow repeat
+ for x in llow repeat
x = a => return(a ~= b)
x = b => return false
aa := bb := false$Boolean
- for x in deref lhigh repeat
+ for x in lhigh repeat
if x = a then
bb => return false
aa := true
diff --git a/src/algebra/symbol.spad b/src/algebra/symbol.spad
index 031b43a5..5843a0f8 100644
--- a/src/algebra/symbol.spad
+++ b/src/algebra/symbol.spad
@@ -60,7 +60,7 @@ Symbol() : Exports == Implementation where
import from List(OutputForm)
import from List(%)
- count : Reference(Integer) := ref 0
+ count : Integer := 0
xcount : AssociationList(%, Integer) := empty()
istrings : PrimitiveArray(String) :=
construct ["0","1","2","3","4","5","6","7","8","9"]
@@ -245,8 +245,8 @@ Symbol() : Exports == Implementation where
if zero?(n) then return ns
new() ==
- sym := anyRadix(count()::Integer, ALPHAS)
- count() := count() + 1
+ sym := anyRadix(count::Integer, ALPHAS)
+ count := count + 1
concat("%",sym)::%
new x ==
@@ -266,7 +266,7 @@ Symbol() : Exports == Implementation where
script(xx::%, scripts x)
resetNew() ==
- count() := 0
+ count := 0
for k in keys xcount repeat remove!(k, xcount)
void
diff --git a/src/algebra/view3D.spad b/src/algebra/view3D.spad
index 9538ec53..08c8d3ee 100644
--- a/src/algebra/view3D.spad
+++ b/src/algebra/view3D.spad
@@ -400,11 +400,11 @@ ThreeDimensionalViewport() : Exports == Implementation where
degrees := pi()$F / 180.0
degreesSF := pi()$SF / 180
- defaultTheta : Reference(SF) := ref(convert(pi()$F/4.0)@SF)
- defaultPhi : Reference(SF) := ref(convert(-pi()$F/4.0)@SF)
- defaultZoom : Reference(SF) := ref(convert(1.2)@SF)
- defaultDeltaX : Reference(SF) := ref 0
- defaultDeltaY : Reference(SF) := ref 0
+ defaultTheta : SF := convert(pi()$F/4.0)@SF
+ defaultPhi : SF := convert(-pi()$F/4.0)@SF
+ defaultZoom : SF := convert(1.2)@SF
+ defaultDeltaX : SF := 0
+ defaultDeltaY : SF := 0
--%Local Functions
@@ -438,16 +438,16 @@ ThreeDimensionalViewport() : Exports == Implementation where
else
v.flags.style := rendered
v.viewpoint := viewpoint(v.optionsField,
- [deref defaultTheta, deref defaultPhi, deref defaultZoom, _
- 1$SF, 1$SF, 1$SF, deref defaultDeltaX, deref defaultDeltaY])
+ [defaultTheta, defaultPhi, defaultZoom, _
+ 1$SF, 1$SF, 1$SF, defaultDeltaX, defaultDeltaY])
-- etc - 3D specific stuff...
--%Exported Functions : Default Settings
viewport3D() ==
[0,typeVIEW3D,"FriCAS3D",[viewPosDefault().1,viewPosDefault().2], _
[viewSizeDefault().1, viewSizeDefault().2], _
- [deref defaultTheta, deref defaultPhi, deref defaultZoom, _
- 1$SF, 1$SF, 1$SF, deref defaultDeltaX, deref defaultDeltaY], _
+ [defaultTheta, defaultPhi, defaultZoom, _
+ 1$SF, 1$SF, 1$SF, defaultDeltaX, defaultDeltaY], _
[0, 27], [noControl, rendered, yes, no, yes, no], _
[0$SF, 0$SF, 1$SF, 0$SF, 0$SF, 1$SF], _
[yes, EYED, HITHER], [0$SF, 1$SF, 0$SF, 1$SF, 0$SF, 1$SF, no, yes], _
@@ -563,25 +563,25 @@ ThreeDimensionalViewport() : Exports == Implementation where
viewport
-- the key (now set to 0) should be what the viewport returns
- viewThetaDefault == convert(defaultTheta())@F
+ viewThetaDefault == convert(defaultTheta)@F
viewThetaDefault t ==
- defaultTheta() := convert(t)@SF
+ defaultTheta := convert(t)@SF
t
- viewPhiDefault == convert(defaultPhi())@F
+ viewPhiDefault == convert(defaultPhi)@F
viewPhiDefault t ==
- defaultPhi() := convert(t)@SF
+ defaultPhi := convert(t)@SF
t
- viewZoomDefault == convert(defaultZoom())@F
+ viewZoomDefault == convert(defaultZoom)@F
viewZoomDefault t ==
- defaultZoom() := convert(t)@SF
+ defaultZoom := convert(t)@SF
t
- viewDeltaXDefault == convert(defaultDeltaX())@F
+ viewDeltaXDefault == convert(defaultDeltaX)@F
viewDeltaXDefault t ==
- defaultDeltaX() := convert(t)@SF
+ defaultDeltaX := convert(t)@SF
t
- viewDeltaYDefault == convert(defaultDeltaY())@F
+ viewDeltaYDefault == convert(defaultDeltaY)@F
viewDeltaYDefault t ==
- defaultDeltaY() := convert(t)@SF
+ defaultDeltaY := convert(t)@SF
t
--Exported Functions: Available features for 3D viewports