MathGroup Archive 2000

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

Search the Archive

Re: Rule


We will need to prevent {a=b;b=c;e=f} evaluating.

Hold[{a = b; b = c; e = f}] /. {CompoundExpression[x__]} -> List[x]

        Hold[{a = b; b = c; e = f}]

ToExpression[StringReplace[ToString[Hold[{a = b; b = c; e = f}]],
    ";" -> ","]]

Hold[{a = b, b = c, e = f}]
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Wissam Alsaidi" <alsaidi at pacific.mps.ohio-state.edu> wrote in message
news:8nlifh$9hs at smc.vnet.net...
> Hi all;
> Is there a rule for transforming ; to ,(comma).
> IN THIS case one can transform a set of expressions to a list.
>
> example
> {a=b;b=c;e=f}/.{;->,}
> and the ansere will be
> {a=b,b=c,e=f}.
>
>
>
>




  • Prev by Date: Re: How to get two values from a file into two lists?
  • Next by Date: RE: Animate
  • Previous by thread: Rule
  • Next by thread: ErrorLogPlot?