aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/aggcat.spad.pamphlet2
-rw-r--r--src/algebra/any.spad.pamphlet16
-rw-r--r--src/algebra/boolean.spad.pamphlet8
-rw-r--r--src/algebra/data.spad.pamphlet2
-rw-r--r--src/algebra/domain.spad.pamphlet6
-rw-r--r--src/algebra/files.spad.pamphlet2
-rw-r--r--src/algebra/laurent.spad.pamphlet2
-rw-r--r--src/algebra/list.spad.pamphlet12
-rw-r--r--src/algebra/mappkg.spad.pamphlet5
-rw-r--r--src/algebra/ore.spad.pamphlet2
-rw-r--r--src/algebra/padic.spad.pamphlet2
-rw-r--r--src/algebra/pattern.spad.pamphlet2
-rw-r--r--src/algebra/sex.spad.pamphlet4
-rw-r--r--src/algebra/strap/BOOLEAN.lsp4
-rw-r--r--src/algebra/strap/ILIST.lsp2
-rw-r--r--src/algebra/stream.spad.pamphlet10
-rw-r--r--src/algebra/string.spad.pamphlet2
-rw-r--r--src/algebra/syntax.spad.pamphlet8
-rw-r--r--src/algebra/table.spad.pamphlet6
19 files changed, 50 insertions, 47 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index a23c9e4e..67f5a488 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -60,7 +60,7 @@ Aggregate: Category == Type with
if % has finiteAggregate then
#: % -> NonNegativeInteger ++ # u returns the number of items in u.
add
- eq?(a,b) == EQ(a,b)$Lisp
+ eq?(a,b) == %peq(a,b)$Foreign(Builtin)
sample() == empty()
if % has finiteAggregate then
empty? a == #a = 0
diff --git a/src/algebra/any.spad.pamphlet b/src/algebra/any.spad.pamphlet
index 758b47f6..60aa47e9 100644
--- a/src/algebra/any.spad.pamphlet
+++ b/src/algebra/any.spad.pamphlet
@@ -33,7 +33,7 @@ import OutputForm
None():SetCategory == add
coerce(none:%):OutputForm == "NONE" :: OutputForm
- x:% = y:% == EQ(x,y)$Lisp
+ x:% = y:% == %peq(x,y)$Foreign(Builtin)
@
@@ -53,7 +53,7 @@ RuntimeValue(): Type with
++ \spad{eq(x,y)} holds if both values \spad{x} and \spad{y}
++ resides at the same address in memory.
== add
- eq(x,y) == EQ(x,y)$Foreign(Builtin)
+ eq(x,y) == %peq(x,y)$Foreign(Builtin)
@
@@ -84,9 +84,11 @@ Maybe(T: CoercibleTo OutputForm): Public == Private where
nothing: %
++ \spad{nothing} represents failure or absence of value.
Private == add
- nothing == %nothing$Lisp
+ import %nothing: % from Foreign Builtin
+ import %peq: (%,%) -> Boolean from Foreign Builtin
+ nothing == %nothing
just x == x : %
- x case nothing == EQ(x,%nothing$Lisp)$Lisp
+ x case nothing == %peq(x,%nothing)
x case T == not(x case nothing)
autoCoerce x == x : T
coerce(x: T): % == just x
@@ -181,7 +183,7 @@ Any(): SetCategory with
x = y ==
case (x,y) is
(x': exist(S: BasicType) . S, y': S) => x' = y'
- otherwise => EQ(x,y)$Foreign(Builtin)
+ otherwise => %peq(x,y)$Foreign(Builtin)
coerce(x):OutputForm ==
case x is
@@ -296,7 +298,7 @@ Property(): Public == Private where
v := value x
val :=
null? v => false::OutputForm
- EQ(v,'T)$Lisp => true::OutputForm
+ %peq(v,'T)$Foreign(Builtin) => true::OutputForm
v::OutputForm
bracket(infix(outputForm '_=_>, name(x)::OutputForm,
@@ -371,7 +373,7 @@ Contour(): Public == Private where
findBinding(n,c) ==
for b in bindings c repeat
- EQ(n, name b)$Lisp => return just b
+ %peq(n, name b)$Foreign(Builtin) => return just b
nothing
push(b,c) ==
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet
index 6bf5188e..6fe9cd58 100644
--- a/src/algebra/boolean.spad.pamphlet
+++ b/src/algebra/boolean.spad.pamphlet
@@ -410,7 +410,7 @@ Reference(S:Type): Type with
== add
Rep := Record(value: S)
- p = q == EQ(p, q)$Lisp
+ p = q == %peq(p,q)$Foreign(Builtin)
ref v == [v]
elt p == p.value
setelt(p, v) == p.value := v
@@ -474,7 +474,7 @@ Boolean(): Join(OrderedFinite, Logic, PropositionalLogic, ConvertibleTo InputFor
== add
import %false: % from Foreign Builtin
import %true: % from Foreign Builtin
- import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %peq: (%,%) -> Boolean from Foreign Builtin
import %and: (%,%) -> % from Foreign Builtin
import %or: (%,%) -> % from Foreign Builtin
import %not: % -> % from Foreign Builtin
@@ -493,9 +493,9 @@ Boolean(): Join(OrderedFinite, Logic, PropositionalLogic, ConvertibleTo InputFor
xor(a, b) == (a => %not b; b)
nor(a, b) == (a => %false; %not b)
nand(a, b) == (a => %not b; %true)
- a = b == %eq(a,b)
+ a = b == %peq(a,b)
implies(a, b) == (a => b; %true)
- equiv(a,b) == %eq(a, b)
+ equiv(a,b) == %peq(a, b)
a < b == (b => %not a; %false)
size() == 2
diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet
index 54fabe49..81f574cc 100644
--- a/src/algebra/data.spad.pamphlet
+++ b/src/algebra/data.spad.pamphlet
@@ -72,7 +72,7 @@ ByteOrder(): Public == Private where
unknownEndian == %unknownEndian$Foreign(Builtin)
littleEndian == %littleEndian$Foreign(Builtin)
bigEndian == %bigEndian$Foreign(Builtin)
- x = y == EQ(x,y)$Foreign(Builtin)
+ x = y == %peq(x,y)$Foreign(Builtin)
coerce(x: %): OutputForm ==
outputForm
x = littleEndian => 'litteEndian
diff --git a/src/algebra/domain.spad.pamphlet b/src/algebra/domain.spad.pamphlet
index 4e42fd6f..1e810607 100644
--- a/src/algebra/domain.spad.pamphlet
+++ b/src/algebra/domain.spad.pamphlet
@@ -32,7 +32,7 @@ ConstructorKind(): Public == Private where
category == 'category : %
domain == 'domain : %
package == 'package : %
- k1 = k2 == EQ(k1,k2)$Lisp
+ k1 = k2 == %peq(k1,k2)$Foreign(Builtin)
coerce(k: %): OutputForm == k : OutputForm
@
@@ -355,8 +355,8 @@ SystemPredicate(): Public == Private where
Private == add
x = y == EQUAL(x,y)$Lisp
coerce(x: %): OutputForm ==
- NOT(x)$Lisp => 'false::OutputForm
- EQ(x,'T)$Lisp => 'true::OutputForm
+ %not(x)$Foreign(Builtin) => 'false::OutputForm
+ %peq(x,'T)$Foreign(Builtin) => 'true::OutputForm
EQCAR(x,'NOT)$Lisp => not(CADR(x)$Lisp : % :: OutputForm)
@
diff --git a/src/algebra/files.spad.pamphlet b/src/algebra/files.spad.pamphlet
index 737b3720..6f288a23 100644
--- a/src/algebra/files.spad.pamphlet
+++ b/src/algebra/files.spad.pamphlet
@@ -38,7 +38,7 @@ IOMode(): Public == Private where
output == _$OutputIOMode$Foreign(Builtin)
bothWays == _$BothWaysIOMode$Foreign(Builtin)
closed == _$ClosedIOMode$Foreign(Builtin)
- x = y == EQ(x,y)$Foreign(Builtin)
+ x = y == %peq(x,y)$Foreign(Builtin)
coerce m ==
m = input => outputForm 'input
m = output => outputForm 'output
diff --git a/src/algebra/laurent.spad.pamphlet b/src/algebra/laurent.spad.pamphlet
index 1bfafeea..3eef1e0f 100644
--- a/src/algebra/laurent.spad.pamphlet
+++ b/src/algebra/laurent.spad.pamphlet
@@ -207,7 +207,7 @@ UnivariateLaurentSeriesConstructor(Coef,UTS):_
--% predicates
x = y ==
- EQ(x,y)$Lisp => true
+ %peq(x,y)$Foreign(Builtin) => true
(expDiff := getExpon(x) - getExpon(y)) = 0 =>
getUTS(x) = getUTS(y)
abs(expDiff) > _$streamCount$Lisp => false
diff --git a/src/algebra/list.spad.pamphlet b/src/algebra/list.spad.pamphlet
index eb0913ef..7290f770 100644
--- a/src/algebra/list.spad.pamphlet
+++ b/src/algebra/list.spad.pamphlet
@@ -57,7 +57,7 @@ IndexedList(S:Type, mn:Integer): Exports == Implementation where
add
import %nil: % from Foreign Builtin
import %makepair: (S,%) -> % from Foreign Builtin
- import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %peq: (%,%) -> Boolean from Foreign Builtin
import %lempty?: % -> Boolean from Foreign Builtin
import %head: % -> S from Foreign Builtin
import %tail: % -> % from Foreign Builtin
@@ -66,7 +66,7 @@ IndexedList(S:Type, mn:Integer): Exports == Implementation where
#x == LENGTH(x)$Lisp
concat(s:S,x:%) == %makepair(s,x)
- eq?(x,y) == %eq(x,y)
+ eq?(x,y) == %peq(x,y)
first x == SPADfirst(x)$Lisp
elt(x,"first") == SPADfirst(x)$Lisp
empty() == %nil
@@ -110,21 +110,21 @@ IndexedList(S:Type, mn:Integer): Exports == Implementation where
-- displays cycle with overbar over the cycle
y := empty()$List(OutputForm)
s := cycleEntry x
- while not %eq(x, s) repeat
+ while not %peq(x, s) repeat
y := concat((first x)::OutputForm, y)
x := rest x
y := reverse! y
empty? s => bracket y
-- cyclic case: z is cylic part
z := list((first x)::OutputForm)
- while not %eq(s, rest x) repeat
+ while not %peq(s, rest x) repeat
x := rest x
z := concat((first x)::OutputForm, z)
bracket concat!(y, overbar commaSeparate reverse! z)
if S has SetCategory then
x = y ==
- %eq(x,y) => true
+ %peq(x,y) => true
while not Qnull x and not Qnull y repeat
%head x ~=$S %head y => return false
x := %tail x
@@ -181,7 +181,7 @@ IndexedList(S:Type, mn:Integer): Exports == Implementation where
merge!(f, p, q) ==
Qnull p => q
Qnull q => p
- %eq(p, q) => error "cannot merge a list into itself"
+ %peq(p, q) => error "cannot merge a list into itself"
if f(%head p, %head q)
then (r := t := p; p := %tail p)
else (r := t := q; q := %tail q)
diff --git a/src/algebra/mappkg.spad.pamphlet b/src/algebra/mappkg.spad.pamphlet
index 18814966..6bd8d8dd 100644
--- a/src/algebra/mappkg.spad.pamphlet
+++ b/src/algebra/mappkg.spad.pamphlet
@@ -124,6 +124,7 @@ MappingPackage1(A:SetCategory): MPcat == MPdef where
MPdef == add
import MappingPackageInternalHacks1(A)
+ import %peq: (A,A) -> Boolean from Foreign Builtin
a: A
faa: A -> A
@@ -134,13 +135,13 @@ MappingPackage1(A:SetCategory): MPcat == MPdef where
fixedPoint faa ==
g0 := GENSYM()$Lisp
g1 := faa g0
- EQ(g0, g1)$Lisp => error "All points are fixed points"
+ %peq(g0,g1) => error "All points are fixed points"
GEQNSUBSTLIST([g0]$Lisp, [g1]$Lisp, g1)$Lisp
fixedPoint(fll, n) ==
g0 := [(GENSYM()$Lisp):A for i in 1..n]
g1 := fll g0
- or/[EQ(e0,e1)$Lisp@Boolean for e0 in g0 for e1 in g1] =>
+ or/[%peq(e0,e1) for e0 in g0 for e1 in g1] =>
error "All points are fixed points"
GEQNSUBSTLIST(g0, g1, g1)$Lisp
diff --git a/src/algebra/ore.spad.pamphlet b/src/algebra/ore.spad.pamphlet
index 4542935d..126af607 100644
--- a/src/algebra/ore.spad.pamphlet
+++ b/src/algebra/ore.spad.pamphlet
@@ -307,7 +307,7 @@ Automorphism(R:Ring): Join(Group, Eltable(R, R)) with
1 == ident
err r == error "Morphism is not invertible"
ident(r, n) == r
- f = g == EQ(f, g)$Lisp
+ f = g == %peq(f,g)$Foreign(Builtin)
elt(f, r) == apply(f, r, 1)
inv f == apply(f, #1, - #2)
(f: %) ** (n: Integer) == apply(f, #1, n * #2)
diff --git a/src/algebra/padic.spad.pamphlet b/src/algebra/padic.spad.pamphlet
index 47c53e8a..d7265998 100644
--- a/src/algebra/padic.spad.pamphlet
+++ b/src/algebra/padic.spad.pamphlet
@@ -442,7 +442,7 @@ PAdicRationalConstructor(p,PADIC): Exports == Implementation where
--% arithmetic
x = y ==
- EQ(x,y)$Lisp => true
+ %peq(x,y)$Foreign(Builtin) => true
n := getExpon(x) - getExpon(y)
n >= 0 =>
(p**(n :: NNI) * getZp(x)) = getZp(y)
diff --git a/src/algebra/pattern.spad.pamphlet b/src/algebra/pattern.spad.pamphlet
index ec7878f4..fd008b3e 100644
--- a/src/algebra/pattern.spad.pamphlet
+++ b/src/algebra/pattern.spad.pamphlet
@@ -221,7 +221,7 @@ Pattern(R:SetCategory): Exports == Implementation where
p1 = p2 ==
(p1.cons? = p2.cons?) and (p1.lev = p2.lev) and
(p1.topvar = p2.topvar) and
- ((EQ(p1.toppred, p2.toppred)$Lisp) pretend B) and
+ ((%peq(p1.toppred,p2.toppred)$Foreign(Builtin)) pretend B) and
pateq?(p1.pat, p2.pat)
isPower p ==
diff --git a/src/algebra/sex.spad.pamphlet b/src/algebra/sex.spad.pamphlet
index 89613f49..bb5df1f5 100644
--- a/src/algebra/sex.spad.pamphlet
+++ b/src/algebra/sex.spad.pamphlet
@@ -33,7 +33,7 @@ SExpressionCategory(Str, Sym, Int, Flt, Expr): Category == Decl where
ConvertibleFrom List %, Eltable(Integer,%),_
Eltable(List Integer, %)) with
eq: (%,%) -> Boolean
- ++ eq(s, t) is true if EQ(s,t) is true in Lisp.
+ ++ eq(s, t) is true if %peq(s,t) is true for pointers.
null?: % -> Boolean
++ null?(s) is true if s is the S-expression ().
atom?: % -> Boolean
@@ -112,7 +112,7 @@ SExpressionOf(Str, Sym, Int, Flt, Expr): Decl == Body where
paren blankSeparate l1
b1 = b2 == EQUAL(b1,b2)$Lisp
- eq(b1, b2) == EQ(b1,b2)$Lisp
+ eq(b1, b2) == %peq(b1,b2)$Foreign(Builtin)
null? b == NULL(b)$Lisp
atom? b == ATOM(b)$Lisp
diff --git a/src/algebra/strap/BOOLEAN.lsp b/src/algebra/strap/BOOLEAN.lsp
index f1f08c88..e1866956 100644
--- a/src/algebra/strap/BOOLEAN.lsp
+++ b/src/algebra/strap/BOOLEAN.lsp
@@ -56,7 +56,7 @@
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;=;3$;13|))
-(PUT '|BOOLEAN;=;3$;13| '|SPADreplace| '|%eq|)
+(PUT '|BOOLEAN;=;3$;13| '|SPADreplace| '|%peq|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;implies;3$;14|))
@@ -64,7 +64,7 @@
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;equiv;3$;15|))
-(PUT '|BOOLEAN;equiv;3$;15| '|SPADreplace| '|%eq|)
+(PUT '|BOOLEAN;equiv;3$;15| '|SPADreplace| '|%peq|)
(DECLAIM (FTYPE (FUNCTION (|%Boolean| |%Boolean| |%Shell|) |%Boolean|)
|BOOLEAN;<;3$;16|))
diff --git a/src/algebra/strap/ILIST.lsp b/src/algebra/strap/ILIST.lsp
index 3f05b3f2..6852cb5f 100644
--- a/src/algebra/strap/ILIST.lsp
+++ b/src/algebra/strap/ILIST.lsp
@@ -14,7 +14,7 @@
(DECLAIM (FTYPE (FUNCTION (|%List| |%List| |%Shell|) |%Boolean|)
|ILIST;eq?;2$B;3|))
-(PUT '|ILIST;eq?;2$B;3| '|SPADreplace| '|%eq|)
+(PUT '|ILIST;eq?;2$B;3| '|SPADreplace| '|%peq|)
(DECLAIM (FTYPE (FUNCTION (|%List| |%Shell|) |%Thing|)
|ILIST;first;$S;4|))
diff --git a/src/algebra/stream.spad.pamphlet b/src/algebra/stream.spad.pamphlet
index 79c37753..fc4be2d0 100644
--- a/src/algebra/stream.spad.pamphlet
+++ b/src/algebra/stream.spad.pamphlet
@@ -100,7 +100,7 @@ LazyStreamAggregate(S:Type): Category == StreamAggregate(S) with
explicitlyFinite? x and explicitlyFinite? y =>
entries x = entries y
explicitEntries? x and explicitEntries? y =>
- frst x = frst y and EQ(rst x, rst y)$Lisp
+ frst x = frst y and %peq(rst x,rst y)$Foreign(Builtin)
-- treat cyclic streams
false
@@ -664,8 +664,8 @@ Stream(S): Exports == Implementation where
Rep := Record(firstElt: S, restOfStream: %)
- explicitlyEmpty? x == EQ(frst x,NullStream)$Lisp
- lazy? x == EQ(frst x,NonNullStream)$Lisp
+ explicitlyEmpty? x == %peq(frst x,NullStream)$Foreign(Builtin)
+ lazy? x == %peq(frst x,NonNullStream)$Foreign(Builtin)
--% signatures of local functions
@@ -922,7 +922,7 @@ Stream(S): Exports == Implementation where
lazyEvaluate x ==
st := lazyEval x
setfrst!(x, frst st)
- setrst!(x,if EQ(rst st,st)$Lisp then x else rst st)
+ setrst!(x,if %peq(rst st,st)$Foreign(Builtin) then x else rst st)
x
-- empty? is the only function that explicitly causes evaluation
@@ -931,7 +931,7 @@ Stream(S): Exports == Implementation where
while lazy? x repeat
st := lazyEval x
setfrst!(x, frst st)
- setrst!(x,if EQ(rst st,st)$Lisp then x else rst st)
+ setrst!(x,if %peq(rst st,st)$Foreign(Builtin) then x else rst st)
explicitlyEmpty? x
--setvalue(x,s) == setfirst!(x,s)
diff --git a/src/algebra/string.spad.pamphlet b/src/algebra/string.spad.pamphlet
index e97d0501..8a1a0210 100644
--- a/src/algebra/string.spad.pamphlet
+++ b/src/algebra/string.spad.pamphlet
@@ -324,7 +324,7 @@ IndexedString(mn:Integer): Export == Implementation where
(startpos := startpos - mn) < 0 => error "index out of bounds"
startpos >= Qsize t => mn - 1
r:I := STRPOS(s, t, startpos, NIL$Lisp)$Lisp
- EQ(r, NIL$Lisp)$Lisp => mn - 1
+ %peq(r, NIL$Lisp)$Foreign(Builtin) => mn - 1
r + mn
position(c: Character, t: %, startpos: I) ==
(startpos := startpos - mn) < 0 => error "index out of bounds"
diff --git a/src/algebra/syntax.spad.pamphlet b/src/algebra/syntax.spad.pamphlet
index 1579e187..0adfc2dc 100644
--- a/src/algebra/syntax.spad.pamphlet
+++ b/src/algebra/syntax.spad.pamphlet
@@ -272,7 +272,7 @@ ElaboratedExpression(): Public == Private where
++ is a call form.
Private == add
- import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %peq: (%,%) -> Boolean from Foreign Builtin
import %pair?: % -> Boolean from Foreign Builtin
isAtomic(x: %): Boolean ==
ATOM(x)$Lisp
@@ -290,7 +290,7 @@ ElaboratedExpression(): Public == Private where
constant? x ==
isAtomic x and
- %eq(getUnnameIfCan(x)$Lisp, _$immediateDataSymbol$Lisp)
+ %peq(getUnnameIfCan(x)$Lisp, _$immediateDataSymbol$Lisp)
getConstant x ==
constant? x => getValue(x)$Lisp @ SExpression
@@ -586,10 +586,10 @@ Identifier(): Public == Private where
++ \spad{gensym()} returns a new identifier, different from
++ any other identifier in the running system
Private == add
- import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %peq: (%,%) -> Boolean from Foreign Builtin
import %gensym: () -> % from Foreign Builtin
gensym() == %gensym()
- x = y == %eq(x,y)
+ x = y == %peq(x,y)
coerce(x: %): Symbol == x : Symbol
coerce(x: %): OutputForm == x : OutputForm
diff --git a/src/algebra/table.spad.pamphlet b/src/algebra/table.spad.pamphlet
index d69d72c2..12adc7f0 100644
--- a/src/algebra/table.spad.pamphlet
+++ b/src/algebra/table.spad.pamphlet
@@ -39,13 +39,13 @@ HashTable(Key, Entry, hashfn): Exports == Implementation where
Ex ==> OutputForm
failMsg := GENSYM()$Lisp
- t1 = t2 == EQ(t1, t2)$Lisp
+ t1 = t2 == %peq(t1,t2)$Foreign(Builtin)
keys t == HKEYS(t)$Lisp
# t == HCOUNT(t)$Lisp
setelt(t, k, e) == HPUT(t,k,e)$Lisp
remove!(k:Key, t:%) ==
r := HGET(t,k,failMsg)$Lisp
- not EQ(r,failMsg)$Lisp =>
+ not %peq(r,failMsg)$Foreign(Builtin) =>
HREM(t, k)$Lisp
r pretend Entry
"failed"
@@ -55,7 +55,7 @@ HashTable(Key, Entry, hashfn): Exports == Implementation where
search(k:Key, t:%) ==
r := HGET(t, k, failMsg)$Lisp
- not EQ(r, failMsg)$Lisp => r pretend Entry
+ not %peq(r,failMsg)$Foreign(Builtin) => r pretend Entry
"failed"
@