Re: selfdefined operators
- To: mathgroup at smc.vnet.net
- Subject: [mg23015] Re: [mg22989] selfdefined operators
- From: Carl Woll <carlw at u.washington.edu>
- Date: Tue, 11 Apr 2000 23:18:33 -0400 (EDT)
- References: <200004090545.BAA13108@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Roland,
Since your definition for CirclePlus satisfies associativity,
(x \[CirclePlus] y) \[CirclePlus] z = x \[CirclePlus] (y \[CirclePlus]
z)
you can just use the attribute Flat. So the simplest solution is to just
give CirclePlus the attributes Flat and OneIdentity, as in
SetAttributes[CirclePlus, {Flat, OneIdentity}]
x_ \[CirclePlus] y_ := x y/(x+y)
Carl
Roland Koppenberger wrote:
> I have defined the operator \[CirclePlus] in the following way:
>
> x_ \[CirclePlus] y_ := x y /(x + y)
>
> When type in
>
> 1 \[CirclePlus] 2
>
> I get 2/3 as the right result. But when I try to compute
>
> 1 \[CirclePlus] 2 \[CirclePlus] 3
>
> the result will not be computed. How can I specify the operator in a
> general way?
- References:
- selfdefined operators
- From: Roland Koppenberger <roland@koppenberger.com>
- selfdefined operators