Re: Complex -> List does not work
- To: mathgroup@smc.vnet.net
- Subject: [mg10691] Re: Complex -> List does not work
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Fri, 30 Jan 1998 04:24:28 -0500
- References: <6ak4jr$2ub$2@dragonfly.wolfram.com>
David
> One of the basic principles of replacement rules is that replacements
> are not made inside of atomic expressions.
> ...........
> When you enter 2 + 3 I, or Complex[2, 3], the input is a normal expression,
> not an atom.
> The corresponding atomic complex number is constructed only when these
> inputs are evaluated.
How about the following
In[1]:=
Complex[2,3]/.Complex[x_,y_]->List[x,y]
Out[1]=
{2, 3}
and
In[43]:=
Complex[2,3]
Out[2]=
2 + 3 I
In[3]:=
%/.Complex[x_,y_]->List[x,y]
Out[3]=
{2, 3}
--
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642