MathGroup Archive 2009

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

Search the Archive

Re: StringJoin with ToString

replicatorzed at wrote:

> If I use a different name (e.g. ExtendedStringJoin, as it was
> suggested), I loose the effective shorthand version (<>), as it would
> still use the original function. Is there a way to overwrite at least
> the definitions of the infix operator?

You can't overwrite it (as far as I know), and in some ways that would 
be as bad as redefining the actual function, but you can co-opt an 
unused operator:

In[1]:= SetAttributes[CirclePlus, Flat];
SetAttributes[CirclePlus, OneIdentity];

In[3]:= CirclePlus[x___] := f[x]

In[4]:= a\[CirclePlus]b\[CirclePlus]c\[CirclePlus]d

Out[4]= f[a, b, c, d]

David Bailey

  • Prev by Date: NetLink SEHException in getDefaultLaunchString
  • Next by Date: Re: how to build pattern for a square matrix of reals?
  • Previous by thread: Re: StringJoin with ToString
  • Next by thread: Re: StringJoin with ToString