aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/op.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-05-15 19:38:25 +0000
committerdos-reis <gdr@axiomatics.org>2009-05-15 19:38:25 +0000
commitee573325df58dbcc33596630d2710ad2cd37a77d (patch)
treecc70f7c9c4f174b8576a16f61da0f511ae8bc954 /src/algebra/op.spad.pamphlet
parent530c1ee0f24568ecb6d61c3ce2c7af1863595fdf (diff)
downloadopen-axiom-ee573325df58dbcc33596630d2710ad2cd37a77d.tar.gz
* algebra/algfunc.spad.pamphlet (AlgebraicFunction): User
Identifiers for property names. * algebra/combfunc.spad.pamphlet: Likewise. * algebra/constant.spad.pamphlet: Likewise. * algebra/efstruc.spad.pamphlet: Likewise. * algebra/elemntry.spad.pamphlet: Likewise. * algebra/expr.spad.pamphlet: Likewise. * algebra/fspace.spad.pamphlet: Likewise. * algebra/intef.spad.pamphlet: Likewise. * algebra/integrat.spad.pamphlet: Likewise. * algebra/kl.spad.pamphlet: Likewise. * algebra/laplace.spad.pamphlet: Likewise. * algebra/limitps.spad.pamphlet: Likewise. * algebra/liouv.spad.pamphlet: Likewise. * algebra/rdeef.spad.pamphlet: Likewise. * algebra/pfo.spad.pamphlet: Likewise. * algebra/op.spad.pamphlet: Likewise. * algebra/odeef.spad.pamphlet: Likewise. * algebra/manip.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra/op.spad.pamphlet')
-rw-r--r--src/algebra/op.spad.pamphlet31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/algebra/op.spad.pamphlet b/src/algebra/op.spad.pamphlet
index 54f8639c..d8987ace 100644
--- a/src/algebra/op.spad.pamphlet
+++ b/src/algebra/op.spad.pamphlet
@@ -86,8 +86,6 @@ BasicOperator(): Exports == Implementation where
++ it has one attached, "failed" otherwise.
is? : ($, Symbol) -> Boolean
++ is?(op, s) tests if the name of op is s.
- has? : ($, String) -> Boolean
- ++ has?(op, s) tests if property s is attached to op.
has? : (%, Identifier) -> Boolean
++ \spad{has?(op,p)} tests if property \spad{s} is attached to \spad{op}.
assert : ($, String) -> $
@@ -142,7 +140,6 @@ BasicOperator(): Exports == Implementation where
otherwise => nothing
assert(op: %, s: String) == setProperty(op, s, NIL$Lisp)
assert(op: %, p: Identifier) == setProperty(op, p, NIL$Lisp)
- has?(op: %, name: String) == key?(name, rep(op).props)
has?(op: %, name: Identifier) == key?(STRING(name)$Lisp, rep(op).props)
weight(op, n) == setProperty(op, WEIGHT, n pretend None)
nullary? op == zero? rep(op).narg
@@ -229,9 +226,6 @@ BasicOperator(): Exports == Implementation where
++ Keywords: operator.
BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
OP ==> BasicOperator
- EVAL ==> "%eval"
- CONST ==> "%constant"
- DIFF ==> "%diff"
Exports ==> with
evaluate : (OP, List A) -> Union(A, "failed")
@@ -270,22 +264,25 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
++ nullary operator always returning \spad{a}, "failed" otherwise.
Implementation ==> add
+ macro EVAL == '%eval
+ macro CONST == '%constant
+ macro DIFF == '%diff
evaluate(op:OP, func:A -> A) == evaluate(op, func first #1)
evaluate op ==
- (func := property(op, EVAL)) case "failed" => "failed"
- (func::None) pretend (List A -> A)
+ (func := property(op, EVAL)) case nothing => "failed"
+ (func@None) pretend (List A -> A)
evaluate(op:OP, args:List A) ==
- (func := property(op, EVAL)) case "failed" => "failed"
- ((func::None) pretend (List A -> A)) args
+ (func := property(op, EVAL)) case nothing => "failed"
+ ((func@None) pretend (List A -> A)) args
evaluate(op:OP, func:List A -> A) ==
setProperty(op, EVAL, func pretend None)
derivative op ==
- (func := property(op, DIFF)) case "failed" => "failed"
- ((func::None) pretend List(List A -> A))
+ (func := property(op, DIFF)) case nothing => "failed"
+ ((func@None) pretend List(List A -> A))
derivative(op:OP, grad:List(List A -> A)) ==
setProperty(op, DIFF, grad pretend None)
@@ -310,14 +307,14 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
csex(a, l) == a
eqconst?(a, b) ==
- (va := property(a, CONST)) case "failed" => not has?(b, CONST)
+ (va := property(a, CONST)) case nothing => not has?(b, CONST)
((vb := property(b, CONST)) case None) and
- ((va::None) pretend A) = ((vb::None) pretend A)
+ ((va@None) pretend A) = ((vb@None) pretend A)
ltconst?(a, b) ==
- (va := property(a, CONST)) case "failed" => has?(b, CONST)
+ (va := property(a, CONST)) case nothing => has?(b, CONST)
((vb := property(b, CONST)) case None) and
- ((va::None) pretend A) < ((vb::None) pretend A)
+ ((va@None) pretend A) < ((vb@None) pretend A)
constOp a ==
setProperty(display(copy opconst, cdisp(a::OutputForm, #1)),
@@ -325,7 +322,7 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
constantOpIfCan op ==
is?(op,'constant) and
- ((u := property(op, CONST)) case None) => (u::None) pretend A
+ ((u := property(op, CONST)) case None) => (u@None) pretend A
"failed"
if A has ConvertibleTo InputForm then