MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Defining /@-like operator

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118245] Re: Defining /@-like operator
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Sun, 17 Apr 2011 19:14:53 -0400 (EDT)
  • References: <ioekal$n0i$1@smc.vnet.net>

István Zachar wrote:

> Dear Group,
>
> I would like to define a new operator of the form "x /==> y", where
> the operator "/==>" is treated as e.g. the "/@" operator of Map, and
> is translated to MyFunction[x, y]. There is one important aspect: I
> want the resulting operator to behave in the frontend like any two-bit
> operator does, that is, the two characters (a Divide and a
> DoubleLongRightArrow) should be connected together, no syntax
> coloration should appear, and they are to be selected together when
> clicked, so precedence must be set. Also, I'd rather avoid using the
> Notation package.
> As a result, I'd like to see somehting like this:
>
> In[11]:= FullForm[x/\[DoubleLongRightArrow]y]
>
> Out[11]//FullForm= MyFunction[x,y]
>
>
> Does anyone have an idea how to achieve this?
> Istvan
>

Maybe you want something like this:

DoubleLongRightArrow[x_, y_] := MyFunction[x, y]
u\[DoubleLongRightArrow]v
7 x\[DoubleLongRightArrow]y/s

Out:
MyFunction[u, v]

(7 MyFunction[x, y])/s

AFAIK you can do so with all Symbols, which have no built-in meaning

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Trignometric rules
  • Next by Date: Solve vs. nonlinearity
  • Previous by thread: Defining /@-like operator
  • Next by thread: ImageMargins and Frame Labels