MathGroup Archive 1997

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

Search the Archive

Re: ReplaceAll strange behaviour

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9340] Re: ReplaceAll strange behaviour
  • From: Hein Hundal <junkmail at vicon.net>
  • Date: Sat, 1 Nov 1997 03:33:26 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Gadi Oron wrote:
> 
> Hello,
> 
> Can anybody enlighten me with the following strange result?
> 
> In:=  {{1,2},{2,3}} /. {x_ /; Head[x]!=List,y_}:> Circle[{x,y},1] Out:=
> {{1,2},{2,3}}
> [snip]

The problem occurs because (Integer != List) does not return True. 
Instead you want to uses =!=.   The following expression works on my
machine w/ Mathematica 3.0.

{{1,2},{2,3}} /. {x_ /; Head[x]=!=List,y_}:> Circle[{x,y},1]


Cheers,
Hein

email replies to hundalhm at vicon.net


  • Prev by Date: Argument typing in Compile
  • Next by Date: RE: Newbie question: big matri
  • Previous by thread: Re: ReplaceAll strange behaviour
  • Next by thread: Re: ReplaceAll strange behaviour