User defined aliases
- To: mathgroup at yoda.ncsa.uiuc.edu
- Subject: User defined aliases
- From: Markus Lautenbacher <Markus.Lautenbacher at ds0.cip.physik.tu-muenchen.de>
- Date: Mon, 12 Nov 90 22:56:30 +0100
Hi mathgroup readers,
perhaps some of you can give me a little advice on the following
problem:
I have defined a function `OperatorProduct' which I want to transform
via pattern matching in something else on the right hand side of
several transformation rules, e.g.
OperatorProduct[a_,b_] := f[a,b]
(What is actually on the right hand side doesn't matter for the
problem I describe here.) Now, `OperatorProduct' is a quite
descriptive but also long name and I wanted to have something shorter.
Since `Alias[]' tells you that `*' is just an alias for `Times' I
tried `<>::=OperatorProduct' (I used `<>' is still unused) in order to
allow for typing just `a <> b' instead of `OperatorProduct[a,b]'.
However, Mathematica refused to accept this alias. Trying several
versions like `<>::=~OperatorProduct~" and likewise forms didn't work
either. Somehow Mathematica seems to resolve `<>' to the mathematical
`less' and `greater' relations instead of a new combined symbol `<>'.
What worked was `op::=OperatorProduct' with a usage like e.g.
`a ~op~ b' but that is not excatly what I wanted.
Does anybody know whether aliases like `*' are hard wired in
Mathematica or is there a simple way to get my `<>' to work. The
important point is that I want to define a new kind of valid _input_
format for the user defined function `OperatorProduct'. If it just
were for formatting the output of `OperatorProduct' the `Infix'
function (p. 278 MathBook) would of course do the job.
Thanks in advance,
MARKUS
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# MARKUS E. LAUTENBACHER, #
# office: Technical University Munich, Physics Department #
# Theoretical Physics T31, WD-8046 Garching, FRG #
# phone: 0049/89/3209-2398 #
# INTERNET: lauten at ds0.cip.physik.tu-muenchen.de #
# private: Gohrenstr. 4/319, WD-8000 Muenchen 19, FRG #
#-------------------------------------------------------------------------#
# SIR ERNEST RUTHERFORD: `Science is physics, and the rest is #
# stamp collecting' #
# Surely Rutherford (1871-1937) knew nothing about computers! ;-) #
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+