Re: Head logic
- To: mathgroup at smc.vnet.net
- Subject: [mg97056] Re: [mg97033] Head logic
- From: "David Park" <djmpark at comcast.net>
- Date: Wed, 4 Mar 2009 07:11:37 -0500 (EST)
- References: <26933028.1236078461072.JavaMail.root@m02>
In situations like this one ought really use SameQ and UnsameQ. True, in this case one can't assign values to Symbol or Integer, but Mathematica is clearly not using that fact and therefore does not know whether they are Equal or not. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: carlos at colorado.edu [mailto:carlos at colorado.edu] Entering ClearAll[r]; Head[r] Head[r]!=Symbol Head[r]==Symbol give Symbol, False and True as expected. But Head[r]==Integer evaluates to Symbol==Integer. Why not False? Head[r] is certainly not Integer. Likewise r=4; Head[r]==Integer Head[r]!=Symbol Head[r]==Symbol give True (correct) but Integer!=Symbol and Integer==Symbol. Why not True and False?