aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-10-12 16:22:50 +0000
committerdos-reis <gdr@axiomatics.org>2011-10-12 16:22:50 +0000
commita5396a491b1b308b622db3e12da734e6fb1fdb53 (patch)
treecab6fb51f6da78e515bba628b569a4920fff65f0 /src/algebra
parentb630bc7d49b335b41b50293952ffc64b65718a7b (diff)
downloadopen-axiom-a5396a491b1b308b622db3e12da734e6fb1fdb53.tar.gz
* algebra/boolean.spad.pamphlet (Reference) [elt]: Remove.
[setelt]: Likewise. * algebra/lodof.spad.pamphlet: Adjust use. * algebra/float.spad.pamphlet: Likewise. * algebra/divisor.spad.pamphlet: Likewise. * algebra/curve.spad.pamphlet: Likewise. * algebra/card.spad.pamphlet: Likewise. * algebra/algext.spad.pamphlet: Likewise. * algebra/op.spad.pamphlet: Likewise. * algebra/suls.spad.pamphlet: Likewise. * algebra/sups.spad.pamphlet: Likewise. * algebra/supxs.spad.pamphlet: Likewise. * algebra/suts.spad.pamphlet: Likewise. * algebra/symbol.spad.pamphlet: Likewise. * algebra/view3D.spad.pamphlet: Likewise. * algebra/viewDef.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/algext.spad.pamphlet12
-rw-r--r--src/algebra/boolean.spad.pamphlet47
-rw-r--r--src/algebra/card.spad.pamphlet6
-rw-r--r--src/algebra/curve.spad.pamphlet22
-rw-r--r--src/algebra/divisor.spad.pamphlet4
-rw-r--r--src/algebra/float.spad.pamphlet63
-rw-r--r--src/algebra/lodof.spad.pamphlet18
-rw-r--r--src/algebra/op.spad.pamphlet2
-rw-r--r--src/algebra/suls.spad.pamphlet2
-rw-r--r--src/algebra/sups.spad.pamphlet170
-rw-r--r--src/algebra/supxs.spad.pamphlet2
-rw-r--r--src/algebra/suts.spad.pamphlet6
-rw-r--r--src/algebra/symbol.spad.pamphlet6
-rw-r--r--src/algebra/view3D.spad.pamphlet20
-rw-r--r--src/algebra/viewDef.spad.pamphlet48
15 files changed, 210 insertions, 218 deletions
diff --git a/src/algebra/algext.spad.pamphlet b/src/algebra/algext.spad.pamphlet
index b5e2d470..ddd0a29b 100644
--- a/src/algebra/algext.spad.pamphlet
+++ b/src/algebra/algext.spad.pamphlet
@@ -118,19 +118,19 @@ SimpleAlgebraicExtension(R:CommutativeRing,
map(lift, v)$VectorFunctions2($, UP))
discriminant() ==
- if nodisc?() then mkDisc false
- disc()
+ if deref nodisc? then mkDisc false
+ deref disc
mkDisc b ==
- nodisc?() := b
- disc() := discriminant M
+ setref(nodisc?,b)
+ setref(disc,discriminant M)
traceMatrix() ==
- if nodiscmat?() then mkDiscMat false
+ if deref nodiscmat? then mkDiscMat false
discmat
mkDiscMat b ==
- nodiscmat?() := b
+ setref(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/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
index 7562b3b5..4e307819 100644
--- a/src/algebra/boolean.spad.pamphlet
+++ b/src/algebra/boolean.spad.pamphlet
@@ -392,42 +392,35 @@ PropositionalFormulaFunctions2(S,T): Public == Private where
)abbrev domain REF Reference
++ Author: Stephen M. Watt
++ Date Created:
-++ Date Last Changed: May 27, 2009
-++ Basic Operations: deref, elt, ref, setelt, setref, =
+++ Date Last Changed: October 11, 2011
+++ Basic Operations: deref, ref, setref, =
++ Related Constructors:
++ Keywords: reference
++ Description: \spadtype{Reference} is for making a changeable instance
++ of something.
-Reference(S:Type): Type with
+Reference(S:Type): SetCategory with
ref : S -> %
- ++ ref(n) creates a pointer (reference) to the object n.
- elt : % -> S
- ++ elt(n) returns the object n.
- setelt: (%, S) -> S
- ++ setelt(n,m) changes the value of the object n to m.
- -- alternates for when bugs don't allow the above
+ ++ \spad{ref(s)} creates a reference to the object \spad{s}.
deref : % -> S
- ++ deref(n) is equivalent to \spad{elt(n)}.
+ ++ \spad{deref(r)} returns the object referenced by \spad{r}
setref: (%, S) -> S
- ++ setref(n,m) same as \spad{setelt(n,m)}.
- = : (%, %) -> Boolean
- ++ a=b tests if \spad{a} and b are equal.
- if S has SetCategory then SetCategory
-
+ ++ setref(r,s) reset the reference \spad{r} to refer to \spad{s}
+ = : (%, %) -> Boolean
+ ++ \spad{a=b} tests if \spad{a} and \spad{b} are equal.
== add
- Rep := Record(value: S)
-
- p = q == %peq(p,q)$Foreign(Builtin)
- ref v == [v]
- elt p == p.value
- setelt(p, v) == p.value := v
- deref p == p.value
- setref(p, v) == p.value := v
-
- if S has SetCategory then
- coerce p ==
- prefix('ref::OutputForm, [p.value::OutputForm])
+ Rep == Record(value: S)
+ import %peq: (%,%) -> Boolean from Foreign Builtin
+
+ p = q == %peq(p,q)
+ ref v == per [v]
+ deref p == rep(p).value
+ setref(p, v) == rep(p).value := v
+ coerce p ==
+ obj :=
+ S has CoercibleTo OutputForm => rep(p).value::OutputForm
+ '?::OutputForm
+ prefix('ref::OutputForm, [obj])
@
diff --git a/src/algebra/card.spad.pamphlet b/src/algebra/card.spad.pamphlet
index 1bd14450..10f67729 100644
--- a/src/algebra/card.spad.pamphlet
+++ b/src/algebra/card.spad.pamphlet
@@ -144,7 +144,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]
+ deref GCHypothesis => [max(x.order-1, y.order) + 1, DUMMYval]
error "Transfinite exponentiation only implemented under GCH"
finite? x == x.order = FINord
@@ -159,8 +159,8 @@ CardinalNumber: Join(OrderedSet, AbelianMonoid, Monoid,
"failed"
-- State manipulation
- generalizedContinuumHypothesisAssumed?() == GCHypothesis()
- generalizedContinuumHypothesisAssumed b == (GCHypothesis() := b)
+ generalizedContinuumHypothesisAssumed?() == deref GCHypothesis
+ generalizedContinuumHypothesisAssumed b == setref(GCHypothesis,b)
@
\section{License}
diff --git a/src/algebra/curve.spad.pamphlet b/src/algebra/curve.spad.pamphlet
index d69d6bfe..14f770e5 100644
--- a/src/algebra/curve.spad.pamphlet
+++ b/src/algebra/curve.spad.pamphlet
@@ -603,8 +603,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; deref discPoly)
+ radcand() == (INIT; deref newrad)
integralBasis() == (INIT; diag ibasis)
integralBasisAtInfinity() == (INIT; diag infbasis)
basisvec() == (INIT; ibasis)
@@ -696,19 +696,19 @@ RadicalFunctionField(F, UP, UPUP, radicnd, n): Exports == Impl where
charPintbas(r.poly, (r.coef) x, infbasis, invinfbasis)
startUp b ==
- brandNew?() := b
+ setref(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)
+ setref(discPoly,primitivePart(numer dsc) / denom(dsc))
char0StartUp() ==
rp := rootPoly(radicnd, n)
rp.exponent ~= n => error "RadicalFunctionField: curve is not irreducible"
- newrad() := rp.radicand
- ib := iBasis(newrad(), n)
+ setref(newrad,rp.radicand)
+ ib := iBasis(deref newrad, n)
infb := inftyBasis(radicnd, n)
invden:RF := 1
for i in mini..maxIndex ib repeat
@@ -791,8 +791,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; deref infBr?)
+ discriminant() == (INIT; deref discPoly)
integralBasis() == (INIT; vect ibasis)
integralBasisAtInfinity() == (INIT; vect infbasis)
integralMatrix() == (INIT; ibasis)
@@ -842,7 +842,7 @@ AlgebraicFunctionField(F, UP, UPUP, modulus): Exports == Impl where
invinfbasis(i, j) := invib2(i, j)
startUp b ==
- brandNew?() := b
+ setref(brandNew?,b)
nmod:UP2 := map(retract, modulus)
ib := integralBasis()$FunctionFieldIntegralBasis(UP, UP2,
SimpleAlgebraicExtension(UP, UP2, nmod))
@@ -861,9 +861,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)
+ setref(infBr?,degree(numer dsc0) < degree(denom dsc0))
dsc := dsc * determinant(ibasis) ** 2
- discPoly() := primitivePart(numer dsc) / denom(dsc)
+ setref(discPoly,primitivePart(numer dsc) / denom(dsc))
integralDerivationMatrix d ==
w := integralBasis()
diff --git a/src/algebra/divisor.spad.pamphlet b/src/algebra/divisor.spad.pamphlet
index 86feaf9e..888ff89e 100644
--- a/src/algebra/divisor.spad.pamphlet
+++ b/src/algebra/divisor.spad.pamphlet
@@ -531,11 +531,11 @@ FramedModule(R, F, UP, A, ibasis): Exports == Implementation where
false
invintmat() ==
- if iflag?() then iflag?() := getinvintmat()
+ if deref iflag? then setref(iflag?,getinvintmat())
imat
intmat() ==
- if wflag?() then wflag?() := getintmat()
+ if deref wflag? then setref(wflag?,getintmat())
wmat
vectProd(v1, v2) ==
diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet
index 75bc17a5..26c0c253 100644
--- a/src/algebra/float.spad.pamphlet
+++ b/src/algebra/float.spad.pamphlet
@@ -541,8 +541,8 @@ Float():
i := ISQRT i
normalize [i,(e-p) quo 2]
- bits() == BITS()
- bits(n) == (t := bits(); BITS() := n; t)
+ bits() == deref BITS
+ bits(n) == (t := bits(); setref(BITS,n); t)
precision() == bits()
precision(n) == bits(n)
increasePrecision n == (b := bits(); bits((b + n)::PI); b)
@@ -736,7 +736,6 @@ Float():
ceilLength10 n == 146 * LENGTH n quo 485 + 1
floorLength10 n == 643 * LENGTH n quo 2136
--- length10 n == DECIMAL_-LENGTH(n)$Lisp
length10 n ==
ln := LENGTH(n:=abs n)
upper := 76573 * ln quo 254370
@@ -800,20 +799,20 @@ Float():
general : % -> S
padFromLeft(s:S):S ==
- zero? SPACING() => s
+ zero? deref SPACING => s
n:I := #s - 1
- t := new( (n + 1 + n quo SPACING()) :: N , separator )
+ t := new( (n + 1 + n quo deref 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 deref SPACING = 0 then j := j+1
t
padFromRight(s:S):S ==
- SPACING() = 0 => s
+ deref SPACING = 0 => s
n:I := #s - 1
- t := new( (n + 1 + n quo SPACING()) :: N , separator )
+ t := new( (n + 1 + n quo deref 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 deref SPACING = 0 then j := j-1
t
fixed f ==
@@ -821,17 +820,17 @@ Float():
zero? exponent f =>
padFromRight concat(string mantissa f, ".0")
negative? f => concat("-", fixed abs f)
- d := if OUTPREC() = -1 then digits()::I else OUTPREC()
+ d := if deref OUTPREC = -1 then digits()::I else deref OUTPREC
-- g := convert10(abs f,digits); m := g.mantissa; e := g.exponent
g := convert10(abs f,d); m := g.mantissa; e := g.exponent
- if OUTPREC() ~= -1 then
+ if deref 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 > deref OUTPREC and -e < 2*digits()::I then
+ g := normalize10(g,l+e+deref OUTPREC)
m := g.mantissa; e := g.exponent
s := string m; n := #s; o := e+n
- p := if OUTPREC() = -1 then n::I else OUTPREC()
+ p := if deref OUTPREC = -1 then n::I else deref OUTPREC
t:S
if e >= 0 then
s := concat(s, new(e::N, zero))
@@ -843,7 +842,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 deref 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)
@@ -853,12 +852,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? deref SPACING then "E" else " E "
zero? exponent f =>
s := string mantissa f
concat ["0.", padFromLeft s, t, string(#s)]
-- base conversion to decimal rounded to the requested precision
- d := if OUTPREC() = -1 then digits()::I else OUTPREC()
+ d := if deref OUTPREC = -1 then digits()::I else deref OUTPREC
g := convert10(f,d); m := g.mantissa; e := g.exponent
-- I'm assuming that length10 m = # s given n > 0
s := string m; n := #s; o := e+n
@@ -868,12 +867,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 deref OUTPREC = -1 then digits()::I else deref OUTPREC
zero? exponent f =>
d := d + 1
s := string mantissa f
- OUTPREC() ~= -1 and (e := #s) > d =>
- t:S := if zero? SPACING() then "E" else " E "
+ deref OUTPREC ~= -1 and (e := #s) > d =>
+ t:S := if zero? deref SPACING then "E" else " E "
concat ["0.", padFromLeft s, t, string e]
padFromRight concat(s, ".0")
-- base conversion to decimal rounded to the requested precision
@@ -895,26 +894,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? deref SPACING then "E" else " E "
concat ["0.", t, s, string(e+n)]
- 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 == setref(SPACING,n)
+ outputFixed() == (setref(OUTMODE,"fixed"); setref(OUTPREC, -1))
+ outputFixed n == (setref(OUTMODE,"fixed"); setref(OUTPREC,n::I))
+ outputGeneral() == (setref(OUTMODE,"general"); setref(OUTPREC,-1))
+ outputGeneral n == (setref(OUTMODE,"general"); setref(OUTPREC,n::I))
+ outputFloating() == (setref(OUTMODE,"floating"); setref(OUTPREC,-1))
+ outputFloating n == (setref(OUTMODE,"floating"); setref(OUTPREC,n::I))
convert(f):S ==
b:Integer :=
- OUTPREC() = -1 and not zero? f =>
+ deref 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
+ deref OUTMODE = "fixed" => fixed f
+ deref OUTMODE = "floating" => floating f
+ deref OUTMODE = "general" => general f
empty()$String
if positive? b then bits(b::PositiveInteger)
s = empty()$String => error "bad output mode"
diff --git a/src/algebra/lodof.spad.pamphlet b/src/algebra/lodof.spad.pamphlet
index 8d3b8b38..d4247b25 100644
--- a/src/algebra/lodof.spad.pamphlet
+++ b/src/algebra/lodof.spad.pamphlet
@@ -63,8 +63,8 @@ SetOfMIntegersInOneToN(m, n): Exports == Implementation where
member?(p, s) == s.bits.p
enumerate() ==
- if empty? all() then all() := reallyEnumerate()
- all()
+ if empty? deref all then setref(all,reallyEnumerate())
+ deref all
-- enumerates the sets of p integers in 1..q, returns them as sets in 1..n
-- must have p <= q
@@ -81,19 +81,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? deref sz then
+ setref(sz,binomial(n, m)$IntegerCombinatoricFunctions(Integer) :: N)
+ deref sz
lookup s ==
- if empty? all() then all() := reallyEnumerate()
- if zero?(s.pos) then s.pos := position(s, all()) :: N
+ if empty? deref all then setref(all,reallyEnumerate())
+ if zero?(s.pos) then s.pos := position(s, deref all) :: N
s.pos :: PI
index p ==
p > size() => error "index: argument too large"
- if empty? all() then all() := reallyEnumerate()
- all().p
+ if empty? deref all then setref(all,reallyEnumerate())
+ deref(all).p
setOfMinN l ==
s := new(n, false)$Bits
diff --git a/src/algebra/op.spad.pamphlet b/src/algebra/op.spad.pamphlet
index f5914d47..85fdd077 100644
--- a/src/algebra/op.spad.pamphlet
+++ b/src/algebra/op.spad.pamphlet
@@ -462,7 +462,7 @@ CommonOperators(): Exports == Implementation where
e ** x
startUp b ==
- brandNew?() := b
+ setref(brandNew?,b)
display(oppren, paren)
display(opbox, commaSeparate)
display(oppi, dpi)
diff --git a/src/algebra/suls.spad.pamphlet b/src/algebra/suls.spad.pamphlet
index efd567aa..112f103b 100644
--- a/src/algebra/suls.spad.pamphlet
+++ b/src/algebra/suls.spad.pamphlet
@@ -196,7 +196,7 @@ SparseUnivariateLaurentSeries(Coef,var,cen): Exports == Implementation where
coerce(uls:%): OUT ==
st := getStream uls
if not(explicitlyEmpty? st or explicitEntries? st) _
- and (nx := retractIfCan(elt getRef uls))@Union(I,"failed") case I then
+ and (nx := retractIfCan(deref getRef uls))@Union(I,"failed") case I then
count : NNI := _$streamCount$Lisp
degr := min(count,(nx :: I) + count + 1)
extend(uls,degr)
diff --git a/src/algebra/sups.spad.pamphlet b/src/algebra/sups.spad.pamphlet
index b02ea1c0..4a814d60 100644
--- a/src/algebra/sups.spad.pamphlet
+++ b/src/algebra/sups.spad.pamphlet
@@ -223,8 +223,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
coerce(r:Coef) == monomial(r,0)
iSeries(x,refer) ==
- empty? x => (setelt(refer,plusInfinity()); empty())
- setelt(refer,(getExpon frst x) :: COM)
+ empty? x => (setref(refer,plusInfinity()); empty())
+ setref(refer,(getExpon frst x) :: COM)
concat(frst x,iSeries(rst x,refer))
series(x:ST) ==
@@ -240,8 +240,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
1 == monomial(1,0)
iExtend(st,n,refer) ==
- (elt refer) < n =>
- explicitlyEmpty? st => (setelt(refer,plusInfinity()); st)
+ (deref refer) < n =>
+ explicitlyEmpty? st => (setref(refer,plusInfinity()); st)
explicitEntries? st => iExtend(rst st,n,refer)
iExtend(lazyEvaluate st,n,refer)
st
@@ -250,20 +250,20 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
complete x == (iExtend(getStream x,plusInfinity(),getRef x); x)
iTruncate0(x,xRefer,refer,minExp,maxExp,n) == delay
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
nn := n :: COM
- while (elt xRefer) < nn repeat lazyEvaluate x
+ while (deref xRefer) < nn repeat lazyEvaluate x
explicitEntries? x =>
(nx := getExpon(xTerm := frst x)) > maxExp =>
- (setelt(refer,plusInfinity()); empty())
- setelt(refer,nx :: COM)
+ (setref(refer,plusInfinity()); empty())
+ setref(refer,nx :: COM)
(nx :: COM) >= minExp =>
concat(makeTerm(nx,getCoef xTerm),_
iTruncate0(rst x,xRefer,refer,minExp,maxExp,nx + 1))
iTruncate0(rst x,xRefer,refer,minExp,maxExp,nx + 1)
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
- setelt(refer,degr :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
+ setref(refer,degr :: COM)
iTruncate0(x,xRefer,refer,minExp,maxExp,degr + 1)
iTruncate(ups,minExp,maxExp) ==
@@ -273,8 +273,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
deg := getExpon frst x
refer := ref((deg - 1) :: COM)
makeSeries(refer,iTruncate0(x,xRefer,refer,minExp,maxExp,deg))
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
refer := ref(degr :: COM)
makeSeries(refer,iTruncate0(x,xRefer,refer,minExp,maxExp,degr + 1))
@@ -299,8 +299,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
explicitEntries? st =>
((r := getExpon frst st) :: COM) >= n => retract(n)@Integer
r
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt refer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref refer)@I
(degr :: COM) >= n => retract(n)@Integer
iOrder(lazyEvaluate st,n,refer)
@@ -313,7 +313,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
zero? ups ==
x := getStream ups; ref := getRef ups
- whatInfinity(n := elt ref) = 1 => explicitlyEmpty? x
+ whatInfinity(n := deref ref) = 1 => explicitlyEmpty? x
count : NNI := _$streamCount$Lisp
for i in 1..count repeat
explicitlyEmpty? x => return true
@@ -328,27 +328,27 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
iMap1(cFcn,eFcn,check?,x,xRefer,refer,n) == delay
-- when this function is called, all terms in 'x' of order < n have been
-- computed and we compute the eFcn(n)th order coefficient of the result
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
-- if terms in 'x' up to order n have not been computed,
-- apply lazy evaluation
nn := n :: COM
- while (elt xRefer) < nn repeat lazyEvaluate x
+ while (deref xRefer) < nn repeat lazyEvaluate x
-- 'x' may now be empty: retest
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
-- must have nx >= n
explicitEntries? x =>
xCoef := getCoef(xTerm := frst x); nx := getExpon xTerm
newCoef := cFcn(xCoef,nx); m := eFcn nx
- setelt(refer,m :: COM)
+ setref(refer,m :: COM)
not check? =>
concat(makeTerm(m,newCoef),_
iMap1(cFcn,eFcn,check?,rst x,xRefer,refer,nx + 1))
zero? newCoef => iMap1(cFcn,eFcn,check?,rst x,xRefer,refer,nx + 1)
concat(makeTerm(m,newCoef),_
iMap1(cFcn,eFcn,check?,rst x,xRefer,refer,nx + 1))
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
- setelt(refer,eFcn(degr) :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
+ setref(refer,eFcn(degr) :: COM)
iMap1(cFcn,eFcn,check?,x,xRefer,refer,degr + 1)
iMap2(cFcn,eFcn,check?,ups) ==
@@ -360,8 +360,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
deg := getExpon frst x
refer := ref(eFcn(deg - 1) :: COM)
makeSeries(refer,iMap1(cFcn,eFcn,check?,x,xRefer,refer,deg))
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
refer := ref(eFcn(degr) :: COM)
makeSeries(refer,iMap1(cFcn,eFcn,check?,x,xRefer,refer,degr + 1))
@@ -379,8 +379,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
-- if terms up to order n have not been computed,
-- apply lazy evaluation
nn := n :: COM
- while (elt xRefer) < nn repeat lazyEvaluate x
- while (elt yRefer) < nn repeat lazyEvaluate y
+ while (deref xRefer) < nn repeat lazyEvaluate x
+ while (deref yRefer) < nn repeat lazyEvaluate y
-- 'x' or 'y' may now be empty: retest
explicitlyEmpty? x => iMap1(op(0,#1),#1,false,y,yRefer,refer,n)
explicitlyEmpty? y => iMap1(op(#1,0),#1,false,x,xRefer,refer,n)
@@ -390,40 +390,40 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
xCoef := getCoef(xTerm := frst x); nx := getExpon xTerm
yCoef := getCoef(yTerm := frst y); ny := getExpon yTerm
nx = ny =>
- setelt(refer,nx :: COM)
+ setref(refer,nx :: COM)
zero? (coef := op(xCoef,yCoef)) =>
iPlus1(op,rst x,xRefer,rst y,yRefer,refer,nx + 1)
concat(makeTerm(nx,coef),_
iPlus1(op,rst x,xRefer,rst y,yRefer,refer,nx + 1))
nx < ny =>
- setelt(refer,nx :: COM)
+ setref(refer,nx :: COM)
concat(makeTerm(nx,op(xCoef,0)),_
iPlus1(op,rst x,xRefer,y,yRefer,refer,nx + 1))
- setelt(refer,ny :: COM)
+ setref(refer,ny :: COM)
concat(makeTerm(ny,op(0,yCoef)),_
iPlus1(op,x,xRefer,rst y,yRefer,refer,ny + 1))
-- y has no term of degree n
explicitEntries? x =>
xCoef := getCoef(xTerm := frst x); nx := getExpon xTerm
- -- can't have elt(yRefer) = infty unless all terms have been computed
- (degr := retract(elt yRefer)@I) < nx =>
- setelt(refer,elt yRefer)
+ -- can't have deref(yRefer) = infty unless all terms have been computed
+ (degr := retract(deref yRefer)@I) < nx =>
+ setref(refer,deref yRefer)
iPlus1(op,x,xRefer,y,yRefer,refer,degr + 1)
- setelt(refer,nx :: COM)
+ setref(refer,nx :: COM)
concat(makeTerm(nx,op(xCoef,0)),_
iPlus1(op,rst x,xRefer,y,yRefer,refer,nx + 1))
-- x has no term of degree n
explicitEntries? y =>
yCoef := getCoef(yTerm := frst y); ny := getExpon yTerm
- -- can't have elt(xRefer) = infty unless all terms have been computed
- (degr := retract(elt xRefer)@I) < ny =>
- setelt(refer,elt xRefer)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ (degr := retract(deref xRefer)@I) < ny =>
+ setref(refer,deref xRefer)
iPlus1(op,x,xRefer,y,yRefer,refer,degr + 1)
- setelt(refer,ny :: COM)
+ setref(refer,ny :: COM)
concat(makeTerm(ny,op(0,yCoef)),_
iPlus1(op,x,xRefer,rst y,yRefer,refer,ny + 1))
-- neither x nor y has a term of degree n
- setelt(refer,xyRef := min(elt xRefer,elt yRefer))
+ setref(refer,xyRef := min(deref xRefer,deref yRefer))
-- can't have xyRef = infty unless all terms have been computed
iPlus1(op,x,xRefer,y,yRefer,refer,retract(xyRef)@I + 1)
@@ -432,14 +432,14 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
xDeg :=
explicitlyEmpty? x => return map(op(0$Coef,#1),ups2)
explicitEntries? x => (getExpon frst x) - 1
- -- can't have elt(xRefer) = infty unless all terms have been computed
- retract(elt xRefer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ retract(deref xRefer)@I
yRefer := getRef ups2; y := getStream ups2
yDeg :=
explicitlyEmpty? y => return map(op(#1,0$Coef),ups1)
explicitEntries? y => (getExpon frst y) - 1
- -- can't have elt(yRefer) = infty unless all terms have been computed
- retract(elt yRefer)@I
+ -- can't have deref(yRefer) = infty unless all terms have been computed
+ retract(deref yRefer)@I
deg := min(xDeg,yDeg); refer := ref(deg :: COM)
makeSeries(refer,iPlus1(op,x,xRefer,y,yRefer,refer,deg + 1))
@@ -460,11 +460,11 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
explicitEntries? x =>
explicitEntries? y => void()
xDeg := (getExpon frst x) :: COM
- while (xDeg + elt(yRefer)) < nn repeat lazyEvaluate y
+ while (xDeg + deref(yRefer)) < nn repeat lazyEvaluate y
explicitEntries? y =>
yDeg := (getExpon frst y) :: COM
- while (yDeg + elt(xRefer)) < nn repeat lazyEvaluate x
+ while (yDeg + deref(xRefer)) < nn repeat lazyEvaluate x
lazyEvaluate x
-- if x = y, then y may now have explicit entries
@@ -476,13 +476,13 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
-- coefficient of the product
productLazyEval(x,xRefer,y,yRefer,n :: COM)
explicitlyEmpty?(x) or explicitlyEmpty?(y) =>
- (setelt(refer,plusInfinity()); empty())
+ (setref(refer,plusInfinity()); empty())
-- must have nx + ny >= n
explicitEntries?(x) and explicitEntries?(y) =>
xCoef := getCoef(xTerm := frst x); xExpon := getExpon xTerm
yCoef := getCoef(yTerm := frst y); yExpon := getExpon yTerm
expon := xExpon + yExpon
- setelt(refer,expon :: COM)
+ setref(refer,expon :: COM)
scRefer := ref(expon :: COM)
scMult := productByTerm(xCoef,xExpon,rst y,yRefer,scRefer,yExpon + 1)
prRefer := ref(expon :: COM)
@@ -492,20 +492,20 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
concat(makeTerm(expon,coef),sm)
explicitEntries? x =>
xExpon := getExpon frst x
- -- can't have elt(yRefer) = infty unless all terms have been computed
- degr := retract(elt yRefer)@I
- setelt(refer,(xExpon + degr) :: COM)
+ -- can't have deref(yRefer) = infty unless all terms have been computed
+ degr := retract(deref yRefer)@I
+ setref(refer,(xExpon + degr) :: COM)
iTimes(x,xRefer,y,yRefer,refer,xExpon + degr + 1)
explicitEntries? y =>
yExpon := getExpon frst y
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
- setelt(refer,(yExpon + degr) :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
+ setref(refer,(yExpon + degr) :: COM)
iTimes(x,xRefer,y,yRefer,refer,yExpon + degr + 1)
- -- can't have elt(xRefer) = infty unless all terms have been computed
- xDegr := retract(elt xRefer)@I
- yDegr := retract(elt yRefer)@I
- setelt(refer,(xDegr + yDegr) :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ xDegr := retract(deref xRefer)@I
+ yDegr := retract(deref yRefer)@I
+ setref(refer,(xDegr + yDegr) :: COM)
iTimes(x,xRefer,y,yRefer,refer,xDegr + yDegr + 1)
ups1:% * ups2:% ==
@@ -513,27 +513,27 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
xDeg :=
explicitlyEmpty? x => return 0
explicitEntries? x => (getExpon frst x) - 1
- -- can't have elt(xRefer) = infty unless all terms have been computed
- retract(elt xRefer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ retract(deref xRefer)@I
yRefer := getRef ups2; y := getStream ups2
yDeg :=
explicitlyEmpty? y => return 0
explicitEntries? y => (getExpon frst y) - 1
- -- can't have elt(yRefer) = infty unless all terms have been computed
- retract(elt yRefer)@I
+ -- can't have deref(yRefer) = infty unless all terms have been computed
+ retract(deref yRefer)@I
deg := xDeg + yDeg + 1; refer := ref(deg :: COM)
makeSeries(refer,iTimes(x,xRefer,y,yRefer,refer,deg + 1))
iDivide(x,xRefer,y,yRefer,rym,m,refer,n) == delay
-- when this function is called, we are computing the nth order
-- coefficient of the result
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
-- if terms up to order n - m have not been computed,
-- apply lazy evaluation
nm := (n + m) :: COM
- while (elt xRefer) < nm repeat lazyEvaluate x
+ while (deref xRefer) < nm repeat lazyEvaluate x
-- 'x' may now be empty: retest
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
-- must have nx >= n + m
explicitEntries? x =>
newCoef := getCoef(xTerm := frst x) * rym; nx := getExpon xTerm
@@ -541,11 +541,11 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
prod := productByTerm(-newCoef,nx - m,rst y,yRefer,prodRefer,1)
sumRefer := ref(nx :: COM)
sum := iPlus1(#1 + #2,rst x,xRefer,prod,prodRefer,sumRefer,nx + 1)
- setelt(refer,(nx - m) :: COM); term := makeTerm(nx - m,newCoef)
+ setref(refer,(nx - m) :: COM); term := makeTerm(nx - m,newCoef)
concat(term,iDivide(sum,sumRefer,y,yRefer,rym,m,refer,nx - m + 1))
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := retract(elt xRefer)@I
- setelt(refer,(degr - m) :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := retract(deref xRefer)@I
+ setref(refer,(degr - m) :: COM)
iDivide(x,xRefer,y,yRefer,rym,m,refer,degr - m + 1)
divide(ups1,deg1,ups2,deg2,r) ==
@@ -568,7 +568,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
(ry := recip yCoef) case "failed" => "failed"
nn := ny :: COM
if taylor? then
- while (elt(xRefer) < nn) repeat
+ while (deref(xRefer) < nn) repeat
explicitlyEmpty? x => return 0
explicitEntries? x => return "failed"
lazyEvaluate x
@@ -579,8 +579,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
explicitEntries? x =>
((deg := getExpon frst x) < ny) and taylor? => return "failed"
deg - 1
- -- can't have elt(xRefer) = infty unless all terms have been computed
- retract(elt xRefer)@I
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ retract(deref xRefer)@I
divide(ups1,nx,ups2,ny,ry :: Coef)
taylorQuoByVar ups ==
@@ -589,15 +589,15 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
compose0(x,xRefer,y,yRefer,yOrd,y1,yn0,n0,refer,n) == delay
-- when this function is called, we are computing the nth order
-- coefficient of the composite
- explicitlyEmpty? x => (setelt(refer,plusInfinity()); empty())
+ explicitlyEmpty? x => (setref(refer,plusInfinity()); empty())
-- if terms in 'x' up to order n have not been computed,
-- apply lazy evaluation
nn := n :: COM; yyOrd := yOrd :: COM
- while (yyOrd * elt(xRefer)) < nn repeat lazyEvaluate x
+ while (yyOrd * deref(xRefer)) < nn repeat lazyEvaluate x
explicitEntries? x =>
xCoef := getCoef(xTerm := frst x); n1 := getExpon xTerm
zero? n1 =>
- setelt(refer,n1 :: COM)
+ setref(refer,n1 :: COM)
concat(makeTerm(n1,xCoef),_
compose0(rst x,xRefer,y,yRefer,yOrd,y1,yn0,n0,refer,n1 + 1))
yn1 := yn0 * y1 ** ((n1 - n0) :: NNI)
@@ -606,11 +606,11 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
prod := iMap1(xCoef * #1,#1,true,z,zRefer,prodRefer,degr)
coRefer := ref((degr + yOrd - 1) :: COM)
co := compose0(rst x,xRefer,y,yRefer,yOrd,y1,yn1,n1,coRefer,degr + yOrd)
- setelt(refer,(degr - 1) :: COM)
+ setref(refer,(degr - 1) :: COM)
iPlus1(#1 + #2,prod,prodRefer,co,coRefer,refer,degr)
- -- can't have elt(xRefer) = infty unless all terms have been computed
- degr := yOrd * (retract(elt xRefer)@I + 1)
- setelt(refer,(degr - 1) :: COM)
+ -- can't have deref(xRefer) = infty unless all terms have been computed
+ degr := yOrd * (retract(deref xRefer)@I + 1)
+ setref(refer,(degr - 1) :: COM)
compose0(x,xRefer,y,yRefer,yOrd,y1,yn0,n0,refer,degr)
iCompose(ups1,ups2) ==
@@ -624,7 +624,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
explicitlyEmpty? y => coefficient(ups1,0) :: %
yOrd : I :=
explicitEntries? y => getExpon frst y
- retract(elt yRefer)@I
+ retract(deref yRefer)@I
compRefer := ref((-1) :: COM)
makeSeries(compRefer,_
compose0(x,xRefer,y,yRefer,yOrd,ups2,1,0,compRefer,0))
@@ -640,15 +640,15 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
integ0: (ST,REF,REF,I) -> ST
integ0(x,intRef,ansRef,n) == delay
nLess1 := (n - 1) :: COM
- while (elt intRef) < nLess1 repeat lazyEvaluate x
- explicitlyEmpty? x => (setelt(ansRef,plusInfinity()); empty())
+ while (deref intRef) < nLess1 repeat lazyEvaluate x
+ explicitlyEmpty? x => (setref(ansRef,plusInfinity()); empty())
explicitEntries? x =>
xCoef := getCoef(xTerm := frst x); nx := getExpon xTerm
- setelt(ansRef,(n1 := (nx + 1)) :: COM)
+ setref(ansRef,(n1 := (nx + 1)) :: COM)
concat(makeTerm(n1,inv(n1 :: RN) * xCoef),_
integ0(rst x,intRef,ansRef,n1))
- -- can't have elt(intRef) = infty unless all terms have been computed
- degr := retract(elt intRef)@I; setelt(ansRef,(degr + 1) :: COM)
+ -- can't have deref(intRef) = infty unless all terms have been computed
+ degr := retract(deref intRef)@I; setref(ansRef,(degr + 1) :: COM)
integ0(x,intRef,ansRef,degr + 2)
integ1: (ST,REF,REF) -> ST
@@ -1057,7 +1057,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where
st := rst st
l :=
explicitlyEmpty? st => l
- (deg := retractIfCan(elt refer)@Union(I,"failed")) case I =>
+ (deg := retractIfCan(deref refer)@Union(I,"failed")) case I =>
concat(prefix("O" :: OUT,[vv ** ((((deg :: I) + 1) * r) :: OUT)]),l)
l
empty? l => (0$Coef) :: OUT
diff --git a/src/algebra/supxs.spad.pamphlet b/src/algebra/supxs.spad.pamphlet
index a911aa38..e8ec5473 100644
--- a/src/algebra/supxs.spad.pamphlet
+++ b/src/algebra/supxs.spad.pamphlet
@@ -85,7 +85,7 @@ SparseUnivariatePuiseuxSeries(Coef,var,cen): Exports == Implementation where
sups : SUPS := laurentRep(x) pretend SUPS
st := getStream sups; refer := getRef sups
if not(explicitlyEmpty? st or explicitEntries? st) _
- and (nx := retractIfCan(elt refer)@Union(I,"failed")) case I then
+ and (nx := retractIfCan(deref refer)@Union(I,"failed")) case I then
count : NNI := _$streamCount$Lisp
degr := min(count,(nx :: I) + count + 1)
extend(sups,degr)
diff --git a/src/algebra/suts.spad.pamphlet b/src/algebra/suts.spad.pamphlet
index ecd46bad..8037b166 100644
--- a/src/algebra/suts.spad.pamphlet
+++ b/src/algebra/suts.spad.pamphlet
@@ -144,7 +144,7 @@ SparseUnivariateTaylorSeries(Coef,var,cen): Exports == Implementation where
-- if terms up to order n have not been computed,
-- apply lazy evaluation
nn := n :: COM
- while (nx := elt refer) < nn repeat lazyEvaluate x
+ while (nx := deref refer) < nn repeat lazyEvaluate x
-- must have nx >= n
explicitEntries? x =>
xCoef := getCoef(xTerm := frst x); xExpon := getExpon xTerm
@@ -163,8 +163,8 @@ SparseUnivariateTaylorSeries(Coef,var,cen): Exports == Implementation where
iSeries(st,n,refer) == delay
-- when this function is called, we are creating the nth order
-- term of a series
- empty? st => (setelt(refer,plusInfinity()); empty())
- setelt(refer,n :: COM)
+ empty? st => (setref(refer,plusInfinity()); empty())
+ setref(refer,n :: COM)
zero? (coef := frst st) => iSeries(rst st,n + 1,refer)
concat(makeTerm(n,coef),iSeries(rst st,n + 1,refer))
diff --git a/src/algebra/symbol.spad.pamphlet b/src/algebra/symbol.spad.pamphlet
index e701270e..25febe15 100644
--- a/src/algebra/symbol.spad.pamphlet
+++ b/src/algebra/symbol.spad.pamphlet
@@ -213,8 +213,8 @@ Symbol(): Exports == Implementation where
if zero?(n) then return ns
new() ==
- sym := anyRadix(count()::Integer,ALPHAS)
- count() := count() + 1
+ sym := anyRadix(deref count,ALPHAS)
+ setref(count, deref count + 1)
concat("%",sym)::%
new x ==
@@ -234,7 +234,7 @@ Symbol(): Exports == Implementation where
script(xx::%,scripts x)
resetNew() ==
- count() := 0
+ setref(count,0)
for k in keys xcount repeat remove!(k, xcount)
scripted? sy ==
diff --git a/src/algebra/view3D.spad.pamphlet b/src/algebra/view3D.spad.pamphlet
index 9d931689..89da76fe 100644
--- a/src/algebra/view3D.spad.pamphlet
+++ b/src/algebra/view3D.spad.pamphlet
@@ -566,25 +566,25 @@ ThreeDimensionalViewport(): Exports == Implementation where
viewport
-- the key (now set to 0) should be what the viewport returns
- viewThetaDefault == convert(defaultTheta())@F
+ viewThetaDefault == convert(deref defaultTheta)@F
viewThetaDefault t ==
- defaultTheta() := convert(t)@SF
+ setref(defaultTheta,convert(t)@SF)
t
- viewPhiDefault == convert(defaultPhi())@F
+ viewPhiDefault == convert(deref defaultPhi)@F
viewPhiDefault t ==
- defaultPhi() := convert(t)@SF
+ setref(defaultPhi,convert(t)@SF)
t
- viewZoomDefault == convert(defaultZoom())@F
+ viewZoomDefault == convert(deref defaultZoom)@F
viewZoomDefault t ==
- defaultZoom() := convert(t)@SF
+ setref(defaultZoom,convert(t)@SF)
t
- viewDeltaXDefault == convert(defaultDeltaX())@F
+ viewDeltaXDefault == convert(deref defaultDeltaX)@F
viewDeltaXDefault t ==
- defaultDeltaX() := convert(t)@SF
+ setref(defaultDeltaX,convert(t)@SF)
t
- viewDeltaYDefault == convert(defaultDeltaY())@F
+ viewDeltaYDefault == convert(deref defaultDeltaY)@F
viewDeltaYDefault t ==
- defaultDeltaY() := convert(t)@SF
+ setref(defaultDeltaY,convert(t)@SF)
t
--Exported Functions: Available features for 3D viewports
diff --git a/src/algebra/viewDef.spad.pamphlet b/src/algebra/viewDef.spad.pamphlet
index 8a6a5f60..3eaa4787 100644
--- a/src/algebra/viewDef.spad.pamphlet
+++ b/src/algebra/viewDef.spad.pamphlet
@@ -152,15 +152,15 @@ ViewDefaultsPackage():Exports == Implementation where
defaultClosed : Reference(B) := ref(false)
--%Viewport window dimensions specifications
- viewPosDefault == [defaultXPos(),defaultYPos()]
+ viewPosDefault == [deref defaultXPos,deref defaultYPos]
viewPosDefault l ==
#l < 2 => error "viewPosDefault expects a list with two elements"
- [defaultXPos() := first l,defaultYPos() := last l]
+ [setref(defaultXPos,first l),setref(defaultYPos,last l)]
- viewSizeDefault == [defaultWidth(),defaultHeight()]
+ viewSizeDefault == [deref defaultWidth,deref defaultHeight]
viewSizeDefault l ==
#l < 2 => error "viewSizeDefault expects a list with two elements"
- [defaultWidth() := first l,defaultHeight() := last l]
+ [setref(defaultWidth,first l),setref(defaultHeight,last l)]
viewDefaults ==
defaultPointColor : Reference(PAL) := ref bright red()
@@ -174,39 +174,39 @@ ViewDefaultsPackage():Exports == Implementation where
defaultHeight : Reference(PI) := ref(427::PI)
--%2D graphical output specifications
- pointColorDefault == defaultPointColor()
- pointColorDefault p == defaultPointColor() := p
+ pointColorDefault == deref defaultPointColor
+ pointColorDefault p == setref(defaultPointColor,p)
- lineColorDefault == defaultLineColor()
- lineColorDefault p == defaultLineColor() := p
+ lineColorDefault == deref defaultLineColor
+ lineColorDefault p == setref(defaultLineColor,p)
- axesColorDefault == defaultAxesColor()
- axesColorDefault p == defaultAxesColor() := p
+ axesColorDefault == deref defaultAxesColor
+ axesColorDefault p == setref(defaultAxesColor,p)
- unitsColorDefault == defaultUnitsColor()
- unitsColorDefault p == defaultUnitsColor() := p
+ unitsColorDefault == deref defaultUnitsColor
+ unitsColorDefault p == setref(defaultUnitsColor,p)
- pointSizeDefault == defaultPointSize()
- pointSizeDefault x == defaultPointSize() := x
+ pointSizeDefault == deref defaultPointSize
+ pointSizeDefault x == setref(defaultPointSize,x)
--%3D specific stuff
- var1StepsDefault == defaultVar1Steps()
- var1StepsDefault i == defaultVar1Steps() := i
+ var1StepsDefault == deref defaultVar1Steps
+ var1StepsDefault i == setref(defaultVar1Steps,i)
- var2StepsDefault == defaultVar2Steps()
- var2StepsDefault i == defaultVar2Steps() := i
+ var2StepsDefault == deref defaultVar2Steps
+ var2StepsDefault i == setref(defaultVar2Steps,i)
- tubePointsDefault == defaultTubePoints()
- tubePointsDefault i == defaultTubePoints() := i
+ tubePointsDefault == deref defaultTubePoints
+ tubePointsDefault i == setref(defaultTubePoints,i)
- tubeRadiusDefault == defaultTubeRadius()
- tubeRadiusDefault f == defaultTubeRadius() := convert(f)@SF
+ tubeRadiusDefault == deref defaultTubeRadius
+ tubeRadiusDefault f == setref(defaultTubeRadius,convert(f)@SF)
--%File output stuff
viewWriteAvailable == writeAvailable
- viewWriteDefault == defaultThingsToWrite()
+ viewWriteDefault == deref defaultThingsToWrite
viewWriteDefault listOfThings ==
thingsToWrite : L S := []
@@ -216,7 +216,7 @@ ViewDefaultsPackage():Exports == Implementation where
" is not a valid file type for writing a viewport")])$Lisp
else
thingsToWrite := append(thingsToWrite,[aTypeOfFile])
- defaultThingsToWrite() := thingsToWrite
+ setref(defaultThingsToWrite,thingsToWrite)
@
\section{License}